Follow this blog by Email

Monday, 2 September 2013

Python Challenge - Caesar cipher with shift

Here is a programming puzzle picked from Python challenge from  early levels , relatively easy but very good exercise for someone who is a python beginner learner.

Below given is a (part) of the translation map used in this Caesar cipher
a -->  c
m --> o
x -->  z

And a ciphertext as below:
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

Find the original text.
To solve this problem using python is very good way to learn about
-- python string(str) class
-- string operations in python(concatenate, etc...)
-- its member functions,
-- slicing

As all these basic concepts are needed in coming up with a simple solution for this puzzle. Will post my solution in few days.

So dive right into the mouth of the Python...

No comments: