This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Author: Anish Mashankar | |
#website: anishm.co | |
import random | |
import time | |
import nltk | |
from textblob import TextBlob | |
from nltk.corpus import stopwords | |
from text.classifiers import NaiveBayesClassifier | |
def get_list_tuples(read_file): | |
list_tuples = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Written by: Anish Mashankar | |
#Blog: http://techieanish.blogspot.com | |
#####BEGIN##### | |
print 'enter capacity of first jug' | |
x_capacity = input() | |
print 'enter capacity of second jug' | |
y_capacity = input() | |
print 'enter goal capacity' | |
x_goal = input() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Written by: Anish Mashankar | |
#Blog: http://techieanish.blogspot.com | |
class WaterJug: | |
def __init__(self, x, y, goal_x, goal_y): | |
self.JUG_1 = x | |
self.JUG_2 = y | |
self.j_1 = 0 | |
self.j_2 = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
board=[' ' for x in range(9)] | |
#legal board values = X,O | |
board[4] = 'X' | |
winning=False | |
def player_move(): | |
global winning | |
pos = input("Enter your move ") | |
board[pos] = 'O' | |
winning = checkwin('O') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
1 1 1 1 | |
1 1 1 1 | |
1 1 1 1 | |
1 1 1 1 | |
''' | |
import heapq | |
from math import sqrt | |
from math import pow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
text = "Virat Kohli has stayed in the shadows even as India knocked off all their six group-stage opponents to reach the quarter-finals of the World Cup. After his 107 against Pakistan in their opening game at the Adelaide Oval, Kohli managed another 194 runs from the next five matches, without a single fifty to his name. He aggregates 301 and does not even find a place in the top-10 run-scorers in the tournament. However, West Indian legend Brian Lara felt the Indian batting mainstay will deliver once the World Cup gets into the business-end from this week" | |
#words = set(text.split(" ")) | |
words = ['ced','ted','med','red','rai','rwq','ren','rem'] | |
to_find = raw_input() | |
first_list = [] | |
found=False | |
for word in words: | |
if len(word) == len(to_find): | |
first_list.append(word) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
symptoms={ | |
'tb' : ['cough', 'pain', 'weight loss', 'exhaustion', 'fever','night sweat','chills'], | |
'dengue': ['pain', 'swollen lympth node', 'fever', 'exhaustion'], | |
'h1n1' : ['cough', 'fever', 'sore throat', 'runny nose', 'pain', 'headache', 'chills', 'exhaustion'] | |
} | |
print 'do you have fever?' | |
fever = input() | |
if fever==0: | |
sys.exit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Created by Anish Mashankar | |
# Website: http://anishm.co | |
# This is a simple script that will download all the Star Wars: The Force Awakens wallpapers | |
# The image files will be stored on the same destination where this script is kept if the promt is left blank | |
# May the force be with you | |
import urllib | |
folder = raw_input("Where do you want your images to be stored? Enter the path to folder") | |
for i in range(1,12): | |
myurl = "https://www.gstatic.com/beyond/img/l"+str(i)+".jpg" |