Python
# Program to reverse a string
s = input("Enter a string: ")
reversed_s = s[::-1]
print("Reversed string:", reversed_s)Output
Enter a string: hello Reversed string: olleh
We use Python's slicing syntax s[::-1] to create a reversed copy of the string.