and click on the “Fork” button at the top. This will create your own copy of the code.
Optional: The starter code has a file called codebank.txt. If you don’t feel comfortable writing your own code from scratch, you can copy the code snippets for each part. You will need to find the right place to use each piece of code, and you’ll need to add your own indentation.
Part 1: Handle user input
Your first task is to have the user guess a letter and let them know if the letter is in your word. To start, we'll let the user guess an infinite number of times.
Example
Assume the word to guess is “collaborative”.
The red text represents user input (as opposed to program output).
Part 2: Keep track of guesses
Your next task is to keep track of how many letters the user has guessed and how many guesses they have remaining.
If the player guesses a letter they have already guessed, do not count it as another guess.
Example
Assume the word to guess is “collaborative”.
The red text represents user input (as opposed to program output).
Part 3: Show the word progress
Your next task is to reveal the location of the guessed letters in the word.
Write a function get_word_progress that takes as input the word to guess and a set of letters that have been guessed. It should return a string that represents the word to guess with unguessed letters replaced by the * character.
Example:
Example (game play)
Assume the word to guess is “collaborative”.
The red text represents user input (as opposed to program output).
Part 4: End the game
The last task is to end the game when the player has either guessed the word or reached the guess limit.
Write a function is_word_guessed that takes as input the word to guess and a set of letters that have been guessed. It should return True if all the letters in the word have been guessed and False otherwise.
Example:
Example (winning game)
Assume the word to guess is “dog”.
The red text represents user input (as opposed to program output).
Example (losing game)
Assume the word to guess is “dog”.
The red text represents user input (as opposed to program output).
Extensions
If you finish early and are looking for ways to extend your game, here are some ideas:
Create a random list of words and select a random word to guess each time (Hint: the