Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def Main():
- n = int(input("Set the number of disks: "))
- a = 'A'
- b = 'B'
- c = 'C'
- Hancula(a, b, c, n)
- def Hancula(a, b, c, n):
- if(n>0):
- Hancula(a, c, b, n-1)
- print("Move a disk from a pylon",a, "to", c)
- Hancula(b, a, c, n-1)
- Main()
Advertisement
Add Comment
Please, Sign In to add comment