Hi everyone, I'm new to programming (and daniweb) and I'm having a small problem with a Caeser Cipher program I'm writing.
messageE = input('\nPlease enter string to encrypt: ')
offsetE = int(input('Please enter offset value (1 to 94): '))
encryptedE = ''
if offsetE < 1 or offsetE > 94:
print('Incorrect input. Please enter a value between 1 and 94.')
messageE = input('\nPlease enter string to encrypt: ')
offsetE = int(input('Please enter offset value (1 to 94): '))
for char in messageE:
encryptedE = encryptedE + chr(ord(char) + offsetE)
print('Encrypted string:\n', encryptedE)
Gives the output:
Please enter string to encrypt: hello
Please enter offset value (1 to 94): 1
Encrypted string:
i
Encrypted string:
if
Encrypted string:
ifm
Encrypted string:
ifmm
Encrypted string:
ifmmp
I only want the final line "ifmmp" to show. How would I go about this? Thanks so much to anyone who can help.