i have following list: parent_child_list
with id-tuples:
[(960, 965), (960, 988), (359, 364), (359, 365),
(361, 366), (361, 367), (361, 368), (361, 369),
(360, 370), (360, 371), (360, 372), (360, 373), (361, 374)]
Example: i would like to print those values which are combined with the id 960. Those would be: 965, 988
I tried to convert the list into a dict:
rs = dict(parent_child_list)
Because now i could simply say:
print rs[960]
But unfortunately i forgot that dict cannot have double values so instead of getting 965, 988 as the answer i receive only 965.
Is there any easy option to keep the double values?
Many thanks