Question: 1) [20 marks] Write a function named enter_guess which will take the list of letters already guessed (initially, this will be an empty list). The
![1) [20 marks] Write a function named enter_guess which will take](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f2f43860b55_26366f2f437d608e.jpg)


1) [20 marks] Write a function named enter_guess which will take the list of letters already guessed (initially, this will be an empty list). The function asks the user to enter a single letter and error checks to ensure that exactly 1 alphabetic character is entered. It will also check to see if the letter has already been guessed. The single letter will be returned. For example: 2) [10 marks] Write a function called get_word which takes a list of words and randomly returns one word. You must use either random.randint or random.choices. For example: > target = get_word(words) > print(target) student 3) [60 marks] Write a function called mouse InARoom which takes a string (a target word) as a parameter. This function displays the initial room and the number of underscores in the target word. As long as the target word has not been guessed or the user has not incorrectly guessed 7 letters, get a letter from the user (call enter_guess), if the letter is not in the target word, increment a counter that keeps track of the number of incorrect guesses and add one more piece to the mouse then person. If the letter is in the target word, replace the underscore in the location of the letter, with the letter. Then display the underscores (possibly including letters) and the letters guessed (sorted alphabetically). Once the target word has been guessed or the user has incorrectly guessed 7 letters, display the results. See screenshots at end. The join method (a string method) can be very helpful in this function. It takes an iterable (like a list) as a parameter and produces a string with the initial string between each of the list items, e.g. "'.join(['a', 'b', 'c', 'd']) would produce the string 'a b c d'. Here is an example of a complete game with the player losing: Lettersguessed:aeiEnteraletter:osLettersguessed:adeimopstYouarenowinaroomwithamouseandaremoreintriguedbythemousethancontinuingwiththegame.Thewordwasschool. 4) [10 marks] Write a function named main which takes no parameters. This function calls get_word to get a target word and then uses this to call the mouseInARoom function. This function returns None. See the following pages for examples of the game being played
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
