words=[]
word=input("Word:")
count=0
while word != '':
count+=1
words.append(word)
word=input("Word:")
for w in words:
if words.count(w)>1:
count-=1
print("You know",count,"unique word(s)")
So what my code does is, it allows the user to input words and then checks to see if they have any duplicate words; if they do, it doesn't count. So after that's done it tells you how many 'unique words' you know.
The problem is: when there are no duplicates it outputs the right amount of 'unique words' however when there are duplicates it outputs the 'right amount of unique words' - 1. So let's say i give in 3 words and 2 of them are duplicates; it will say there's only 1 unique word. Thank you for any help.