recursion | Sololearn: Learn to code for FREE!



How does line 5 in my code work? I do not understand that line of code?

8/8/2019 6:34:20 PM


3 Answers

New Answer


it calls the function with new parameters until the condition evaluates to false and it won't call itself anymore


This code loops, by calling itself, until i==len(a), which is six. So i=0, then adds 1 until i=6. Recursion is calling the define function within itself, it's a loop


i got it after writing the code on paper thanks