The code works. The problem is that it doesn't work as it's supposed to work when the word contains letters which repeat themselves, as I've already stated.
I've just found the solution, though. Instead of using list the conditional, I should use set, and then a word like 'blueberry' works fine:
I've just found the solution, though. Instead of using list the conditional, I should use set, and then a word like 'blueberry' works fine:
if len(good_guesses) == len(set(secret_word)):P.S. to be more explicit, if a word like 'blueberry' is chosen, then the program will never exit, you keep guessing and you're going to be kept in a loop.