Created
November 2, 2012 23:16
-
-
Save max-giro/4004942 to your computer and use it in GitHub Desktop.
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
def buildCoder(shift): | |
dict_letters = {} | |
for letter in string.ascii_letters: | |
dict_letters[letter] = letter | |
for letter in dict_letters: | |
if (string.ascii_letters.find(letter) + shift) in range (0, 52): | |
# | |
dict_letters[letter] = string.ascii_letters[(string.ascii_letters.find(letter) + shift) % 52] | |
else: | |
# | |
print(str(string.ascii_letters.find(letter))) | |
print('up: ' + str(string.ascii_letters.find(letter) + shift)) | |
dict_letters[letter] = string.ascii_letters[(string.ascii_letters.find(letter) + shift) - 26] | |
return dict_letters |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment