Provide a simple game to practice spelling words. Given a list of spelling words, randomly choose one of them. Randomly reveal letters until the user correctly guesses the right word. For each guess, only reveal another letter after a valid spelling word is entered.
Include comments at the top of the file with a description of the script, your name and the date. Additionally, include a descriptive comment before each function and each major section of your code. Describe in English (not code) what the function or section does. Be sure to include any assumptions. Write the comments for another software developer to read, meaning one that already knows Python.
Let's practice some spelling words! Please enter all the spelling words (separated by spaces): wait weight heard herd days daze heel heal peak peek sent cent scent feet feat vain vane vein miner minor Thank you for entering 20 words Here's the mystery word: --a-- Please enter your guess: wait Here's the mystery word: -ea-- Please enter your guess: weight Here's the mystery word: -ear- Please enter your guess: heard Good job! You guessed heard in just 3 guesses!
Let's practice some spelling words! Please enter all the spelling words (separated by spaces): wait weight heard herd days daze heel heal peak peek sent cent scent feet feat vain vane vein miner minor Thank you for entering 20 words Here's the mystery word: ---o- Please enter your guess: wait Here's the mystery word: -i-o- Please enter your guess: weight Here's the mystery word: -i-or Please enter your guess: heard Here's the mystery word: mi-or Please enter your guess: herd Thanks for playing. The word was minor. Let's play again!
Let's practice some spelling words! Please enter all the spelling words (separated by spaces): supercalifragilisticexpialidocious pneumonoultramicroscopicsilicovolcanoconiosis pseudopseudohypoparathyroidism Thank you for entering 3 words Here's the mystery word: -----------------------r------ Please enter your guess: python Sorry, python is not a spelling word Please enter your guess: supercalifragilisticexpialidocious Here's the mystery word: -----------------------r-i---- Please enter your guess: rocks Sorry, rocks is not a spelling word Please enter your guess: please Sorry, please is not a spelling word Please enter your guess: supercalifragilisticexpialidocious Here's the mystery word: -----------------a-----r-i---- Please enter your guess: a Sorry, a is not a spelling word Please enter your guess: I Sorry, I is not a spelling word Please enter your guess: hi Sorry, hi is not a spelling word Please enter your guess: supercalifragilisticexpialidocious Here's the mystery word: -----------o-----a-----r-i---- Please enter your guess: pneumonoultramicroscopicsilicovolcanoconiosis Here's the mystery word: -------s---o-----a-----r-i---- Please enter your guess: pseudopseudohypoparathyroidism Good job! You guessed pseudopseudohypoparathyroidism in just 5 guesses!
Points Item ---------- -------------------------------------------------------------- _____ / 10 Comments before each function and major section of code (written for another software developer; not too many comments and not too few) _____ / 25 Spelling words in a list and mystery word letters in a list _____ / 25 Input validation (only spelling words accepted) _____ / 10 Random spelling word and random letter revealed each iteration _____ / 4 Submitted 1+ days early (bonus) _____ / 2 Completed rubric (estimates for each line including hours spent) _____ / 72 Total _____ Approximate number of hours spent I, (REPLACE WITH YOUR FULL NAME), affirm that the code that I submitted is my own work and that I did not receive help that was not authorized by the instructor.
# prompt the user and get input from the user # while not( valid_input_expression ): # display an error message # prompt the user and get input from the useror
# prompt the user and get input from the user # while invalid_input_expression: # display an error message # prompt the user and get input from the userwhere valid_input_expression is a boolean expression that is
True
if the input is valid and False
otherwise and invalid_input_expression is a boolean expression that is True
if the input is invalid and False
otherwise.