uaveiro-leci/1ano/fp/extra3/ex09.py

9 lines
285 B
Python
Raw Normal View History

2023-01-10 10:45:45 +00:00
def trinsPerMerchandise(trains):
content_dict = {}
for train, content in trains.items():
for item in content:
if item[0] not in content_dict:
content_dict[item[0]] = set()
content_dict[item[0]].add(train)
return content_dict