Thursday, April 14, 2011

Python Challenge Level 01

Obviously, by the hint, we must shift the alphabets to understand the ciphertext. Thus, I wrote as follows.

text = "g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmglegrgl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgleqrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj."
print ''.join(map(lambda x: not x.isalpha() and x or x in "yz" and chr(ord(x)-24) or chr(ord(x)+2),text))

The hint indicates us to apply the shift to the url, which yields "ocr.html".

No comments:

Post a Comment