I am trying to pair the values from the output. I am trying to pair the values to the same key. The code is
key = input("parent_id:")
value = input("child_id:")
myList[key] = [value]
myList
The output is
myList = [{'parent_id' : 123, 'child_id' : 987},
{'parent_id' : 234, 'child_id' : 876},
{'parent_id' : 123, 'child_id' : 765},
{'parent_id' : 345, 'child_id' : 654},
{'parent_id' : 345, 'child_id' : 543}]
I want the output to be:
{ 123 : [987, 765],
234 : [876],
345 : [654, 543] }
How do i go about it?