Write a Python program that accepts a string from user. Your program should create and display a new string where the first and last characters have been exchanged.

For example if the user enters the string 'HELLO' then new string would be 'OELLH'

Source Code

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

Output

Enter a string: HELLO
New string: OELLH