Python Code Creation

Posted by user3677715 on Stack Overflow See other posts from Stack Overflow or by user3677715
Published on 2014-05-26T21:22:36Z Indexed on 2014/05/26 21:25 UTC
Read the original article Hit count: 69

Filed under:

I've been trying to make a simple code where a = e, b = z, and so forth. This is what I have in python so far:

done = False 
while not done: 



Letter = input("Letter:")

if Letter == "a":
    print("e")

if Letter == "e":
    print("a")

if Letter == "b":
    print("z")

if Letter == "z":
    print("b")

if Letter == "c":
    print("x")

if Letter == "x":
    print("c")

if Letter == "d":
    print("w")

if Letter == "w":
    print("d")

if Letter == "f":
    print("v")

if Letter == "v":
    print("f")

input = input("Start over? Y/N :") 
if input == "N": 
    done = True

With this, I can put in only letters, not words. How can I string together multiple letters to create a word?

Thanks

© Stack Overflow or respective owner

Related posts about python