Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!usr/local/bin/python3.8
- # -*- coding: utf-8 -*import
- heroes = input().split(', ')
- info = {}
- while True:
- stuff = input()
- if stuff == 'End':
- break
- tokens = stuff.split('-')
- name = tokens[0]
- item = tokens[1]
- cost = int(tokens[2])
- if name not in info:
- info[name] = [[item], cost]
- elif item not in info[name][0]:
- info[name][0].append(item)
- info[name][1] += cost
- [print(f'{x} -> Items: {len(y[0])}, Cost: {y[1]}') for x, y in info.items()]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement