Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- records = {}
- areas = {}
- while True:
- cmd = input()
- if cmd == "Last Info":
- break
- cmd = cmd.split(":")
- command = cmd[0]
- name = cmd[1]
- value = int(cmd[2])
- area = cmd[3]
- if area not in areas:
- areas[area] = []
- if command == "Add":
- if name not in records:
- records[name] = value
- areas[area] += name
- else:
- records[name] += value
- else:
- if name in records:
- records[name] -= value
- if records[name] <= 0:
- print(f"{name} was successfully fed")
- del records[name]
- for k, v in list(records.items()):
- pass
- print(records)
- print(areas)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement