Not picking repeated m in sammich | Sololearn: Learn to code for FREE!

+1

Not picking repeated m in sammich

word = str(input()) letters = word.split() for i in letters: count = letters.count(i) if count > 1: print('Deja Vu') else: print('Unique')

4/5/2020 5:51:17 PM

Kim 🐘

5 Answers

New Answer

+1

word = str(input()) for i in word: count = word.count(i) if count > 1: print('Deja Vu') else: print('Unique')

+1

"sammich" . split() evals to ["sammich"]

0

Is not the same?

0

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 .

0

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