Guessing game for Study.com's Guessing Game Assignment
- Create a Python project in IDLE and begin the Project Program by developing a Python Function called
display_title()
to display the title and programming specifications for the project. - Expand the Project Program and create a function called
play_game()
that uses therandint()
function that gets the number that the player has to guess. It then returns a random number between 1 and 10. Use awhile
statement so the user can guess the number until the guess is correct. If the users guess is lower than the random number then display the message 'Too low'. If the user guess is higher than the random number then display the message 'Too high'. If the user guess matches the random number display the message, 'You guessed it'. Then, areturn
statement returns to the statement in themain()
function that is after the call to theplay_game()
function. - Expand the Project Program and create
main()
function to the function call statements. From the main function, call thedisplay_title()
function. Then define a variable that will hold the value of yes. Create a loop that will check the variable,while
the variable equals yes then call theplay_game
function. Then allow the user to input if they want to play again. If yes, play again, if no end the program. - Execute the
main()
function
I received a 100/100 on my assignment.