Share
String reversal
Question
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Write a program to reverse the string, passed as an argument.
Answers ( 2 )
def reverse(my_string):
return my_string[::-1]
print(reverse(“hello”))
Output : olleh
def revString(string):
return string[::-1]
def reverse_string(string):
return string[::-1]
def reverseS(string1):
return string1[::-1]