What problem I have?(¿Qué problema tengo?) | Sololearn: Learn to code for FREE!


What problem I have?(¿Qué problema tengo?)


9/15/2021 1:23:28 AM

★«Caleb Guerra Ortega»★

5 Answers

New Answer


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])


Calvin Thomas Hacker-KR4636 ChaoticDawg Thanks to all.


★ⒸⒶⓁⒺⒷ ⒼⓊⒺⓇⓇⒶ ⓄⓇⓉⒺⒼⒶ★ 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


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


Thanks for sharing. I found a lot of interesting information here. https://www.dunkinrunsonyou.net/