利用python实现的汉诺塔。带有图形演示 复制代码 代码如下:from time import sleep def disp_sym(num, sym): print(sym*num, end=”) #recusiondef hanoi(a, b, c, n, tray_num): if n == 1: move_tray(a, c) disp(tray_num) sleep(0.7) else: hanoi(a, c, b, n-1, tray_num) move_tray(a, c) disp(tray_num) sleep(0.7) hanoi(b, a