I am facing issue. I have two lists where one list contains keys say ['a','a','a','b','b','b','b'] but the list was in ['a','b','a','b','a','b'] this form converted into above list by using sorted() and another list contains values say ['1','2','3','4','5','6']. I want to make dictionary using the two lists, How can I do that? I have tried Zip method though it is returing only the last values
My code:
input:lst = ['a','b','a','b','a','b']
lst2 = sorted(lst)
score =[1,2,3,4,5,6]
dictionary = dict(zip(lst2, score))
Output:
{'a':3,'b':6}
What I want is
input:
lst = ['a','b','a','b','a','b']
lst2 = sorted(lst)
score =[1,2,3,4,5,6]
excepted output :
{'a':1,'a':2,'a':3,'b':4,'b':5,'b':6}