I have a list of tuples like this:
list = [(1,2),(1,3),(1,5),(0,8),(0,9),(0,1),(3,6),(3,7)]
I want to build a dictionary with sets of associate values like this:
result = {1:{2,3,5},0:{8,9,1},3:{6,7}}
I have this code:
return {x:y for (x,y) in list}
result = {1: 5, 0: 1, 3: 7}
But I have only the last value, I want all associate values in a set.
Thanks in advance