Replace letters in a secret text

Posted by kame on Stack Overflow See other posts from Stack Overflow or by kame
Published on 2009-12-28T22:33:25Z Indexed on 2010/03/22 21:11 UTC
Read the original article Hit count: 461

Hello! I want to change every letter in a text to after next following letter. But this program doesnt work. Does anyone know why. Thanks in advance. There is also a minor problem with y and z.

import string

letters = string.ascii_lowercase
text=("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. ")
for x in range(1,24):
    text.replace(letters[x],letters[x+2])
print(text)

© Stack Overflow or respective owner

Related posts about python

Related posts about string