String Reverse using recursive function in python

Published: 30 April 2020
on channel: Everything About Computers
850
10

program to reverse a string using recursive function

def reverse_string(s):
if len(s) greater than 0:
print(s[len(s)-1],end="")
reverse_string(s[:len(s)-1])

#main
reverse_string("python")

output:-
nohtyp


Watch video String Reverse using recursive function in python online, duration hours minute second in high quality that is uploaded to the channel Everything About Computers 30 April 2020. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 850 times and liked it 10 visitors.