I'm new to Python. I'm trying to zip 2 lists into a dictionary without losing the values of the duplicated keys and keep values as a list in the dictionary.
Example:
list1 = [0.43, -1.2, 50, -60.5, 50]
list2 = ['tree', 'cat', 'cat', 'tree', 'hat']
I'm trying to get the following outcome:
{'tree': [0.43, -60.5],'cat': [-1.2, 50],'hat': [50]}
Thanks for your help.