I have a list with several words and I want to print the unique words from that list. With "unique" words I mean words that only appear once in my original list. That is, if a word appears twice (or more than twice), then it shouldn't be printed.
Here's my list of words:
my_list = ["door", "table", "door", "chair", "couch", "door", "table", "closet"]
And here's the code I've tried so far:
print(set(my_list))
However, set
prints a list with ALL the words, though there aren't duplicates. That is: door, table, chair, couch, closet
. However, what I want is a list like chair, couch, closet
(because they are the ones that appear only once in the list).