Reverse a String in Python

Source code :

string=str(input("Enter a string:"))
print("Reverse string is ",string[::-1])

Output :

Enter a string:hai
Reverse string is :iah

Output :


                

Comments :