As the title says, I have my program functioning with capitalization but I would like it to have compatibility with uncapitalized and capitalized inputs. It should return as capitalized encryption.
decrypted = b"ABCDEFGHIJKLMNOPQRSTUVWXYZ.1234567890 "
encrypted = b"SE2RL.1W5A0Z8D7H4B9M6JX3FTNVQGPUOYCKI "
encrypt_table = bytes.maketrans(decrypted, encrypted)
decrypt_table = bytes.maketrans(encrypted, decrypted)
result = ''
choice = ''
message = ''
while choice != 'X':
choice = input("\n Do you want to encrypt or decrypt the message?\n E to encrypt, D to decrypt or X to exit program. ")
if choice == 'E':
message = input('\nEnter message for encryption: ')
result = message.translate(encrypt_table)
print(result + '\n\n')
elif choice == 'D':
message = input('\nEnter message to decrypt: ')
result = message.translate(decrypt_table)
print(result + '\n\n')
elif choice != 'X':
print('You have entered an invalid input, please try again. \n\n')