Skip to content

Instantly share code, notes, and snippets.

@codecakes
Created June 16, 2015 20:05
Show Gist options
  • Save codecakes/1d5dfd2f73dd6655b0df to your computer and use it in GitHub Desktop.
Save codecakes/1d5dfd2f73dd6655b0df to your computer and use it in GitHub Desktop.
Cipher TranslationSimple Riddle
#!/usr/bin/env python
#URL: http://www.pythonchallenge.com/pc/def/map.html
from string import letters, maketrans
smallLetters = letters[:26]
shiftLetters = map(lambda let: smallLetters[(let+2)%26], xrange(len(smallLetters)))
table = maketrans(smallLetters, ''.join(shiftLetters))
s = "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."
s.translate(table)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment