5 Answers
New Answerword = str(input()) for i in word: count = word.count(i) if count > 1: print('Deja Vu') else: print('Unique')
even with Oma Falk's correction...your output is:- Unique Unique Deja Vu Deja Vu Unique Unique Unique Don't think that is what you're after is it? You need to define a function that returns True or False and use that in a print function .
you could take the change made by Oma Falk and in if return true and in the else return false in a function called IsDuplicate(word, letter) and call the function from the for loop instead of the if many other ways and styles, happy to discuss more if interested
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message