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?

See more answers at brainly.com

"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.