-1

I am having some trouble trying to do this.

I have this list with same elements. I want to output only the unique elements. I don't even want the numbers that were duplicated.

for ex.

list = [1, 1, 3, 4, 5, 5]

result: [3, 4]

I've been Googling this, but the post usually would talk about resulting such: 1, 3, 4, 5. which is not what I'm looking for.

please help!

Zaid
  • 1
  • 1

1 Answers1

0
import collections
a = [1, 1, 3, 4, 5, 5]
print([item for item, count in collections.Counter(a).items() if count == 1])
Leoli
  • 719
  • 1
  • 9
  • 18