I have 2 lists from which I would like to create a dict.
my list1 is:
[1,2,2,3]
my list2 is:
[['A','B'],['J','K'],[L'','M'],['W','X']]
I would like to make a
dict(zip(list1,list2))
However given that list1 has a repeated key I am loosing one key 2 with its values.
So I would like to join the sublists of list2 based on the repeated values in list 1 .
list1 and list2 are indexed in same order.
The desired output would be :
[['A','B'],['J','K','L','M'],['W','X']]
So I can remove dups of list1 and make the
dict(zip(list1_without_dups,list2_merged_sublists))
Sorry I do not include my try but i have been seeking for similar issues unsuccesfully and not sure how to face it.