Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- resources = {}
- while True:
- line = input()
- if line == "stop":
- break
- quantity = int(input())
- if line not in resources:
- resources[line] = quantity
- else:
- resources[line] += quantity
- for resource, quantity in resources.items():
- print(f"{resource} -> {quantity}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement