I'm trying to add my list's items to a dictionary as extra values of all the keys.
The dictionary and list look like this:
mydic = {'1':22, '2':33, '3':44}
mylist = [23,24,25]
I want my dictionary to look like this:
mydic = {'1': [22, 23], '2': [33,24], '3': [44,25]}
My idea that's not working since "AttributeError: 'tuple' object has no attribute 'add'" was this:
for item in mylist:
for k in mydic.items():
mydic[k].append(item)
What's a better way to put the list's items inside the dictionary?