Discuss / Python / 交作业

交作业

Topic source

Zayn_______

#1 Created at ... [Delete] [Delete and Lock User]

def hannoiFunction(n, a, b, c): if n == 1: print(a + '-->' + c) return None else: hannoiFunction(n - 1, a, c, b) print(a + '-->' + c) hannoiFunction(n - 1, b, a, c)

hannoiFunction(3, 'a', 'b', 'c')


  • 1

Reply