Given a list of lists that contains a tuple and an integer, how to return a dictionary based on a certain element in the list?
[[('A Sam', 'count1'), 1],
[('A Sam', 'count2'), 2],
[('T King', 'count1'), 2],
[('C Baskin', 'count2'), 1]]
Given this, as input, I need to return a dictionary
{"A Sam": [1,2], "T King": [2,0], "C Baskin": [0,1]}
as the output. For a particular key named "A Sam" the value of the dictionary should be a list of count1 and count2 where count1 and count2 are the 2 elements in the list of lists. How would I go about doing this?