# 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
# 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
+91-8400061384
support@ithunt.org