Write a Python program to reverse a string.

def reverse(string):
return string[::-1]
s=input(“Enter the string:”)
print(“Reverse of the string:” ,reverse(s))

OUTPUT

Leave a comment

Create a website or blog at WordPress.com

Up ↑

Design a site like this with WordPress.com
Get started