I am using grok learning and I can't seem to get passed this problem. You need to make a program program where you can enter one word at a time, and be told how many unique words you have entered. You should not count duplicates. The program should stop asking for more words when you enter a blank line.
This is my current code:
words = []
word = input("Word: ")
while word != '':
words.append(word)
word = input("Word: ")
print('You know', len(words), 'unique word(s)!')
It counts the amount of words you enter but I can't figure out how to make it check it the word is unique. Here are the desired outputs:
Word: Chat
Word: Chien
Word: Chat
Word: Escargot
Word:
You know 3 unique word(s)!
Here is another:
Word: Katze
Word: Hund
Word: Maus
Word: Papagei
Word: Schlange
Word:
You know 5 unique word(s)!