0

Alien Flip word challenge

In alien challenge, I was given a task to to flip a word of my choice in English language Please where did I get it wrong?? def reverse_string(string): if len(string) == 0: return string else: return reverse_string(string[1:]) + string[0] reverse_string("Python")

15th Aug 2020, 2:33 PM
Batubo Alafuro
Batubo Alafuro - avatar
3 ответов
+ 3
Proper indention was needed 😊 This could help you👇👇 https://code.sololearn.com/ce6VojhJj2Va/?ref=app
15th Aug 2020, 3:39 PM
SOUMYA
SOUMYA - avatar
+ 1
Add identation to else part.. And missing the printing of returned value.
15th Aug 2020, 2:59 PM
Jayakrishna 🇮🇳
+ 1
Hey Batubo Alafuro Just Correct Your Indentation Of else Part And Yes You Just Wanna Flip Your Word For This You Don’t Need To Define Function. You Can Solve Your Problem With Lesser Space Complexity. For Ex- x=input() print(x[::-1])
15th Aug 2020, 3:45 PM
Rahul Saxena
Rahul Saxena - avatar