+ 1
Understand the code
def solve_toh(n_disks); if n_disks == 0; return solve_toh(n_disks-1) move_disk(n_disks-1) solve_toh(n_disks-1)
2 odpowiedzi
+ 2
It looks like an algorithm for solving tower of hanoi. But it is not the complete code.
To understand it you have to learn recursion (self calling function).
https://www.sololearn.com/learn/662/?ref=app
https://www.sololearn.com/learn/JUMP_LINK__&&__Python__&&__JUMP_LINK/2465/?ref=app
+ 2
Good I'll learn it...