Given
x = [0,1,2,3]
y = [0,4,3,5]
z = [1,6,7,8]
I need something that removes all duplicates over all three lists randomly. So the desired outcome would be something like:
x = [1,2,3]
y = [0,4,5]
z = [6,7,8]
Running it another time should give a different distribution like for example:
x = [0,1,2,3]
y = [4,5]
z = [6,7,8]
All questions I've already found (like this one for example Remove both duplicates in multiple lists python) remove duplicates per list.
Thanks a lot in advance!
EDIT: Here is my current fruitless effort:
duplicatelist = []
for number in y:
if number in x:
duplicatelist.append(number)
for number in z:
if number in x or number in y:
duplicatelist.append(number)
#now I don*t know how to continue