def hanoi(n, src, aux, tgt): if n == 1: print(f"Move disk 1 from {src} to {tgt}") return hanoi(n-1, src, tgt, aux) print(f"Move disk {n} from {src} to {tgt}") hanoi(n-1, aux, src, tgt) n = int(input("Number of disks: ")) hanoi(n, 'A', 'B', 'C')