Hey everyone, just finished the recursion lecture and I understand the idea of recursion, but had trouble understanding old man Grimson's explanation using the Hanoi towers.
His code was:
def hanoi(n,f,t,s):
if n == 1:
print 'move from ' + f + ' to ' + t
else:
hanoi (n-1,f,s,t)
hanoi (1,f,t,s)
hanoi (n-1,s,t,f)
Can someone explain how Python interprets this code in plain english?

Hey! We 've verified this expert answer for you, click below to unlock the details :)

I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!

"old man Grimson"
lol

Looking for something else?

Not the answer you are looking for? Search for more explanations.

## More answers

Looking for something else?

Not the answer you are looking for? Search for more explanations.