Reversing a String with Recursion | Data Structures & Algorithms | Python
HTML-код
- Опубликовано: 8 сен 2024
- Recursion in Python Functions | Python Language Tutorial
Playlist of our series- / @netsetostech
Facebook: www.facebook.c...
Twitter: / netsetos
LinkedIn: / netsetos
Quora: www.quora.com/...
Instagram : www.instagram....
For more information, Please write back to us at netsetos@gmail.com
or call us at +91-9347815104
Join Our Whatsapp Group-chat.whatsapp....
~-~~-~~~-~~-~
Please watch: "LRU Cache (With Python Code) "
• LRU Cache Implementati...
~-~~-~~~-~~-~
Well Explained!
Thank you 🙂
def reverse_string(word):
if len(word) == 0:
return word
return reverse_string(word[1:])+word[0]
print(reverse_string("hello"))
chatgpt se vidwaan banne ko koshish
Well explained, now I get it, wow.
Great!!! Keep Watching😀
You could've used head recursion instead. Your solution creates new strings as you slice.
Thank you, thank you!
Nice explanation. However, this just prints the reverse of the string, it doesn’t return the reverse.
👍
Can anyone tell,how every time last character is split out recursively?
Jai mahakal..