Skip to main content
Post Made Community Wiki by 200_success
Source Link

Here's your full program re-implemented using 200_success's suggestion of using str.translate:

from string import ascii_letters as alphabet

switched = 'azyxewvtisrlpnomqkjhugfdcb'
switched += switched.upper()

entean_translation = str.maketrans(alphabet, switched)

user_text = input("Enter Englsih text:")

print(user_text)
print(user_text.translate(entean_translation))