Answers for "WAP to input a string and reverse the string without the use of built in functions of any shortcuts like slicing in python"

28

reverse string in python

'hello world'[::-1]
'dlrow olleh'
Posted by: Guest on December-06-2019
1

reverse string python recursion

def reverse(string):
    if len(string) == 0:
        return string
    else:
        return reverse(string[1:]) + string[0]
a = str(input("Enter the string to be reversed: "))
print(reverse(a))
Posted by: Guest on January-21-2020

Code answers related to "WAP to input a string and reverse the string without the use of built in functions of any shortcuts like slicing in python"

Python Answers by Framework

Browse Popular Code Answers by Language