Objective:
1st number: Key to the second number
2nd number: Value to the first number but key to the third number
3rd number: Value to the second number
def make_dictionary_list(old_list):
return {key: values for key, *values in old_list}
Input: [(4157, 1, 1), (4157, 1, 10), (4157, 2, 1), (4157, 2, 10), (4157, 3, 1), (4157, 3, 10), (4157, 4, 1), (4157, 4, 10), (4182, 1, 1)]
Output:{4157: [4, 10], 4182: [1, 1]}
The output is not what I want. As stated above, I'd like the 1st number being key to the 2nd number and 2nd number being the key to the 3rd number. How would I go about doing that?
Thanks!