May-28-2020, 11:50 PM
(This post was last modified: May-28-2020, 11:50 PM by lazerwolf101.)
The purpose of my code is to decrypt text in the variable "message". When you run the code it will show all the keys from 1 to 25. And after it will ask an input from a user to choose which key they want. Up to this point the code has worked perfectly but when I input which key I want, it does not print it. That is what I need help with. Here is the code:
![[Image: spq2wz]](https://prnt.sc/spq2wz)
I just need help with at the end please. that would be appreciated thanks.
message = 'khoorCpACqdphClvColdp'
LETTERS = 'abcdefghijklmnopqrstuvwxyz'
for key in range(len(LETTERS)):
translated = ''
for symbol in message:
if symbol in LETTERS:
num = LETTERS.find(symbol)
num = num - key
if num < 0:
num = num + len(LETTERS)
translated = translated + LETTERS[num]
else:
translated = translated + symbol
print('Key #%s: %s' % (key, translated))
option = input("Select your decrypted text. ")
if option == key:
print(option)I just need help with at the end please. that would be appreciated thanks.
