+ 11
What problem I have?(¿Qué problema tengo?)
4 ответов
+ 4
You essentially have an infinite recursive loop.
All you need is;
def spell(t):
if len(t) < 1:
return
print(t[-1])
spell(t[:-1])
+ 6
+ 4
★ⒸⒶⓁⒺⒷ ⒼⓊⒺⓇⓇⒶ ⓄⓇⓉⒺⒼⒶ★ This might give you an idea about it:
def my_func(txt):
if not txt:
return
print(txt[-1])
my_func(txt[:-1])
# If this wasn't part of a challenge, I'd need to point out that recursion is very inefficient for this case
+ 3
Check this code, I will not give you the whole problem solved, so you can think for yourself.
https://code.sololearn.com/chms9dagYZPV/?ref=app