I have a list of tuples like this: mylist = [(1,2,3),(6,1,1),(7,8,1),(3,4,5)]
. If I use the list comprehension slist = [item for sublist in mylist for item in sublist]
, I could get slist = [1,2,3,6,1,1,7,8,1,3,4,5]
.
How should I modify if I need only unique elements in slist
like this [1,2,3,6,7,8,4,5]
?