We developed several variants of the program, with source code as follows:
guessA.py
Our initial version. It is structured with a fake first guess
to get into the main while loop, with the real user input chosen
immediately within the loop body.
guessB.py
A revision of our first version where we ask for the first guess
before the loop, and then ask for each subsequnt guess at the
end of each iteration of the body. We also demonstrate that
the congratulatory message could be done after the loop body (we
could have made such a change in the first version as well).
guessC.py
This uses the basic structure from "guessB" version, but this
time wraps that logic in an outer while loop that manages the
dialog for allowing the user to play multiple rounds of the game
within a single execution of the software.
We will revisit this example soon when exploring user-defined fucntions.