This file contains hidden or 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 mechanize | |
import time | |
browser = mechanize.Browser() | |
print("EZ Verizon SMS Spammer \n") | |
x=0 | |
numbofmessages = int(input("How many times do you want this message sent? ")) | |
to = raw_input("To: ") | |
verizon = "@vtext.com" |
This file contains hidden or 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
def depthFirstSearch(problem): | |
""" | |
Search the deepest nodes in the search tree first. | |
Your search algorithm needs to return a list of actions that reaches the | |
goal. Make sure to implement a graph search algorithm. | |
To get started, you might want to try some of these simple commands to | |
understand the search problem that is being passed in: |
This file contains hidden or 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
#!/bin/python | |
import sys | |
from collections import deque | |
def gen_nbrs(node,move,n): | |
x,y = move[0],move[1] | |
nbr = [] | |
for i in [('+','-'),('-','+'),('-','-'),('+','+')]: | |
a,b = node[0],node[1] | |
if i[0] == '-': | |
a = a - x |
This file contains hidden or 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
def shopSmart(orderList, fruitShops): | |
""" | |
orderList: List of (fruit, numPound) tuples | |
fruitShops: List of FruitShops | |
""" | |
"*** YOUR CODE HERE ***" | |
costs = {} | |
for i in fruitShops: | |
cost = 0 | |
for j in xrange(len(orderList)): |
This file contains hidden or 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
points = {1.047:1.139,2.005:2.087,3.348:3.413,5.719:5.765,7.273:7.304,8.41:8.426,9.117:9.127} | |
avg,slopes = 0.0,set() | |
for i in points: | |
for j in points: | |
if i!=j and (i,j) not in slopes: | |
avg = avg + float(points[j]-points[i])/float(j-i) | |
slopes.add((i,j)) | |
print avg/float(len(points)) |
This file contains hidden or 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
# Prithaj | |
# Problem URL : https://www.hackerrank.com/challenges/rust-murderer | |
from collections import deque | |
T = input() | |
# BFS | |
def return_nodes(N,a,edges): | |
for i in xrange(1,N+1): | |
if i != a and (i,a) not in edges and (a,i) not in edges: | |
yield i |
NewerOlder