Re: [Tutor] Recursion - Beginner

2010-05-28 Thread Alan Gauld
"Shawn Blazer" wrote Hello! I'm a high school student, and I'm having some trouble learning recursion in my class... For example: Trace the sequence of recursive calls that glee(2,1) spawns: def glee ( idol , scrub ) : if idol == 0 : return scrub elif idol < 0 : return scrub + glee ( idol +

Re: [Tutor] Recursion - Beginner

2010-05-28 Thread Emile van Sebille
On 5/28/2010 3:09 PM Shawn Blazer said... Hello! I'm a high school student, and I'm having some trouble learning recursion in my class... For example: Trace the sequence of recursive calls that glee(2,1) spawns: I imagine what you'd need to do is manually follow the code for glee step-by-step

[Tutor] Recursion - Beginner

2010-05-28 Thread Shawn Blazer
Hello! I'm a high school student, and I'm having some trouble learning recursion in my class... For example: Trace the sequence of recursive calls that glee(2,1) spawns: def glee ( idol , scrub ) : if idol == 0 : return scrub elif idol < 0 : return scrub + glee ( idol + 10 , idol % 3 ) else :