Write a Python program that accepts a string from user. Your program should create a new string in reverse of first string and display it.

For example if the user enters the string 'EXAM' then new string would be 'MAXE'

Source Code

#1

text = input('Enter a string: ')
newtext = ''
for ch in text:
    newtext = ch + newtext
print('New string:', newtext)

#2

text = input('Enter a string: ')
newtext = text[::-1]
print('New string:', newtext)

Output

Enter a string: EXAM
New string: MAXE