Program to reverse a given string

# Reverse a String
string = input("Enter a string: ")
reversed_string = string[::-1]
print("Reversed string is:", reversed_string)
Output:
Enter a string: Python
Reversed string is: nohtyP

Leave a Reply

Your email address will not be published. Required fields are marked *