Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s = " "
- people = {}
- while(True):
- s = input().split()
- if(len(s) < 2):
- break
- client = s[0]
- product = s[1]
- num = int(s[2])
- if(client not in people):
- people[client] = {}
- if(product not in people[client]):
- people[client][product] = num
- else:
- people[client][product] += num
- for i in people:
- print(i + ":")
- for j in people[i]:
- print(j, people[i][j])
Advertisement
Add Comment
Please, Sign In to add comment