(n, source, destination, auxiliary)
| 1 | # Recursive Python function to solve the tower of hanoi |
| 2 | def TowerOfHanoi(n, source, destination, auxiliary): |
| 3 | if n == 1: |
| 4 | print("Move disk 1 from source ", source, " to destination ", destination) |
| 5 | return |
| 6 | TowerOfHanoi(n - 1, source, auxiliary, destination) |
| 7 | print("Move disk ", n, " from source ", source, " to destination ", destination) |
| 8 | TowerOfHanoi(n - 1, auxiliary, destination, source) |
| 9 | |
| 10 | |
| 11 | n = 4 |
no outgoing calls
no test coverage detected