Coding a Guessing Game with Three Tries
Here, I try to code a guessing game, where the user only has three tries to guess the secret word, or they lose. The photo below is the blue-print.
Coding a Guessing Game with Three Tries
Here, I try to code a guessing game, where the user only has three tries to guess the secret word, or they lose. The photo below is the blue-print.
Attempt #1
There are a lot of errors with this first attempt. There is a missing semicolon on line 7. Also, there is an error on line 9, as there should be a colon after else, and start a new line.
Attempt #2
The word giraffe in the first line should be in parentheses. I tried to do a while loop, but it was not working, so I decided to do a long "if statement" instead.
Attempt #3
I thought that I should use the word "elif", but instead just needed to say "if" on line 9. Also, the indentation is wrong.
Attempt #5
The formatting is wrong, since the code says "You win" despite not guessing the correct word. My variables are incorrect.
Attempt #6
the last line needs to be indented. I also need to fix the variables on lines 8 and 9. I also need to add an "else" statement.
Attempt #7
I have now successfully create a three try guessing game. There are many different ways to do this, and although it does not look like Mike Dane's finished products, it is still another way to get there.