I am new to python and I want to write a program that asks for a line of input (each number will be separated by a single space.) It would use a simple letter-number substitution cipher. Each letter will be appointed a number. So 1 = a, 2 = b and 3 = c until it reaches 26 = z. From there, however, the cipher would continue on so; 27 = a, 28 = b etc. 0's will be a space. The program will only use 0's and positive numbers. It would also print out the decryption of the message. For example:
Please type a code: 8 5 12 12 15
hello
and another example:
Please type a code: 16 25 20 8 14 0 9 19 0 3 15 15 12
python is cool
At the moment i have tried turning the alphabet into a list like this;
n = int(input("Please type a code: ")x =['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
...and then referring back to it later. However, im not exactly sure how this would work. I've also tried using the .replace() function. Like this:
n = int(input("Please type a code: ")n = n.replace('1','a') #all the way until z and then loop it.print(n)
and so and and so on. But again, i have no idea how to do this properly. Any help would be greatly appreciated. Thanks.