def move(n,a='A',b='B',c='C'): if n < 0: print('out of range') return 1 if not isinstance(n,int): raise TypeError('bad operand type')
if n==1: print(a,'->',c) else: move(n-1,a,c,b) move(1,a,b,c) move(n-1,b,a,c)
Sign in to make a reply
weareguyshot
def move(n,a='A',b='B',c='C'): if n < 0: print('out of range') return 1 if not isinstance(n,int): raise TypeError('bad operand type')