Skip to content

Instantly share code, notes, and snippets.

@max-giro
Created November 2, 2012 23:16
Show Gist options
  • Save max-giro/4004942 to your computer and use it in GitHub Desktop.
Save max-giro/4004942 to your computer and use it in GitHub Desktop.
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