Discuss / Python / 作业

作业

Topic source

少易wang言

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

def move(n,a="A",b="B",c="C"):

    if n==1:

        return print(a,'-->',c)

    else:

        move(n-1,a,c,b)

        print(a,'-->',c)

        move(n-1,b,a,c)


  • 1

Reply