0
Deja Vu - pass 4 /5. What's wrong with my code?
Couldn't pass final hidden test. Please advice what's wrong with my code? given = input() count = 0 for i in given: if i in given[:count]: print("Deja Vu") elif count==(len(given)-1): print("Unique") break else: count += 1 continue
2 odpowiedzi
+ 1
Tested your code with "ajdhfshsbs". Prints "Deja Vu" thrice.
Add "break" after 'print("Deja Vu")', so that that message will be printed only once. And other "break" and "continue" are not needed, but you can keep them.
If you did not understand what I meant, see this code:
https://code.sololearn.com/cLu6qAEO3tvb/?ref=app
+ 1
You are great! Thank you very much. I see now.