Hangman specs not passing

Hi, I am not sure why I am failing these two specs.
For the first one, I set this as the dictionary [“leer”, “reel”, “real”, “rear”]. I don’t get how it gets down to [“real”, “reel”] after registering the secret length.
For the second one, the computer play does first guess “e” and then “l”, so I don’t see what’s the problem.

Hi katherinesan,

The bug here is in the handle_response method. You will need to check if number of the guessed letter in each word is the same as the length of the indices. For your code, “rear” is not rejected because it satisfied your second loop in handle_response. However, if you put a debugger in handle_response, you will see that “indices” is only a length of 1 so the secret _word only has one “r”. You will need to write another conditional to filter out these cases.
For the second spec, make sure in your guess method, you are not counting the letters already guessed or on the board already.
Hope this helps!

Michael Ruan
Alpha Course TA