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

+10

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

https://code.sololearn.com/cYv2FrjwoBXM/?ref=app

9/15/2021 1:23:28 AM

★«Caleb Guerra Ortega»★

5 Answers

New Answer

+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

Calvin Thomas Hacker-KR4636 ChaoticDawg Thanks to all.

+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

0

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