recursion | Sololearn: Learn to code for FREE!

+1

recursion

How does line 5 in my code work?https://code.sololearn.com/c6sCEznJy3RB/#py. I do not understand that line of code?

8/8/2019 6:34:20 PM

Khai123

3 Answers

New Answer

+5

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

+2

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 https://www.sololearn.com/post/131090/?ref=app

+1

i got it after writing the code on paper thanks