Sorry, the topic title is fuzzy, it's hard for me to explain.
I have a dictionary in which each value is a list of items. I want to remove duplicate elements so that each element appears in the lists at least once (preferably once).
Consider the dictionary:
example_dictionary = {"weapon1":[1,2,3],"weapon2":[2,3],"weapon3":[2,3]}
'weapon2' and 'weapon3' have the same meaning, so this should result in:
result_dictionary = {"weapon1":[1],"weapon2":[3],"weapon3":[2]}
since I do not mind order, this can also lead to:
result_dictionary = {"weapon1":[1],"weapon2":[2],"weapon3":[3]}
But when “no choice”, he must leave the meaning. Consider this new dictionary:
example_dictionary = {"weapon1":[1,2,3],"weapon2":[2,3],"weapon3":[2,3],"weapon4":[3]}
now, since he cannot assign "2" or "3" only once, without leaving the key blank, a possible output would be:
result_dictionary = {"weapon1":[1],"weapon2":[3],"weapon3":[2],"weapon4":[3]}
,