You are viewing a single comment's thread. Return to all comments →
from collections import OrderedDict n = int(input()) purchases = OrderedDict() for i in range(n): *key, value = input().split(' ') key = ' '.join(key) purchases[key] = purchases.get(key, 0) + int(value) [print(key, value) for key,value in purchases.items()]
Seems like cookies are disabled on this browser, please enable them to open this website
Collections.OrderedDict()
You are viewing a single comment's thread. Return to all comments →