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 date_fashion(you, date): | |
if you <= 2 or date <= 2: | |
return 0 | |
elif you >= 8 or date >= 8: | |
return 2 | |
else: | |
return 1 |
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 first_last6(nums): | |
if nums[0] == 6: | |
return True | |
elif nums[len(nums) -1] == 6: | |
return True | |
else: | |
return False |
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_pi(): | |
x = [3, 1, 4] | |
return x | |
OlderNewer