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
#code written by Jaken Herman | |
#Mercury | |
#Venus | |
#Earth | |
#Mars | |
#Jupiter | |
#Saturn | |
#Uranus | |
#Neptune |
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
background 0, 0, 0 | |
draw = -> | |
fill random(75, 225), random(25, 225), random(25, 225) | |
noStroke() | |
ellipse mouseX, mouseY, 9, 9 | |
ellipse mouseY, mouseX, 9, 9 |
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
from string import maketrans | |
str = "g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr " \ | |
"ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj." | |
intab = "abcdefghijklmnopqrstuvwxyz" | |
outtab= "cdefghijklmnopqrstuvwxyzab" | |
trantab = maketrans(intab, outtab) | |
print str.translate(trantab) |
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 urllib | |
filehandle = urllib.urlopen("http://www.pythonchallenge.com/pc/def/ocr.html") | |
for lines in filehandle.readlines(): | |
print lines | |
filehandle.close() |
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__ = 'Jaken' | |
def sum_double(a, b): | |
sum = a+b | |
if a==b: | |
dub = sum*2 | |
return dub |
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__ = 'Jaken' | |
def diff21(n): | |
if n >= 21: | |
return (n-21)*2 | |
else: | |
return 21-n |
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__ = 'Jaken' | |
def hello_name(name): | |
return "Hello " + name + "!" |
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__ = 'Jaken' | |
def make_abba(a, b): | |
return a+b+b+a |
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__ = 'Jaken' | |
def cigar_party(cigars, is_weekend): | |
if is_weekend and cigars >= 40: | |
return True | |
elif is_weekend and cigars < 40: | |
return False | |
elif not is_weekend and cigars < 40 and cigars > 60: | |
return False |
OlderNewer