Wrong Guesses
Which of the guesses were wrong? Add two lines to the output: an array of the guessed letters that aren't in the word, in the order they were guessed, and the number of mistakes.
_ A _ A S _ R _ _ T
Hidden letters: 5
Wrong guesses: ["E", "O"]
Mistakes: 2When every guess is right, the array is empty: the program prints Wrong guesses: [] and Mistakes: 0.
A tip: to find out whether a guess is in the word, go through the letters of the word inside the loop over the guesses, like the nested loops in the lesson on loops. A boolean variable can remember whether you've found the letter.
Instructions
Print the wrong guesses as an array.
Below that, print the number of mistakes.
Start programming for free
2/3