Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def milikantsi(amount,tower_1,tower_2,tower_3):
- print(tower_1,tower_2,tower_3)
- if amount > 0:
- milikantsi(amount-1,tower_1,tower_3,tower_2)
- if tower_1:
- tower_3.append(tower_1.pop())
- milikantsi(amount-1,tower_2,tower_1,tower_3)
- n=int(input())
- tower_1=[i for i in range(n)]
- tower_2=[]
- tower_3=[]
- milikantsi(len(tower_1),tower_1,tower_2,tower_3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement