Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tool_magazine = {}
- spindle = {0: 0}
- for i in range(1, 10 + 1):
- key = i
- tool = i
- tool_magazine[key] = tool
- tool_number = input()
- while True:
- if tool_number == "end":
- break
- if spindle[0] == 0:
- for x in tool_magazine:
- if tool_magazine[x] == int(tool_number):
- spindle[0] = int(tool_number)
- tool_magazine[x] = 0
- break
- elif spindle[0] != 0:
- if spindle[0] == int(tool_number):
- pass
- else:
- for y in tool_magazine:
- change_tool = spindle[0]
- if tool_magazine[y] == int(tool_number):
- spindle[0] = int(tool_number)
- tool_magazine[y] = change_tool
- break
- tool_number = input()
- print(tool_magazine)
Advertisement
Add Comment
Please, Sign In to add comment