Question: Create the following functions for your program: 1 . display _ gallows ( num _ incorrect ) given the number of incorrect guesses the user
Create the following functions for your program:
displaygallowsnumincorrect given the number of incorrect guesses the
user has made, display the state of the hangman on the gallows ex zero incorrect
guesses should show an empty gallows, incorrect guesses should show the complete
hanged man
displaylettersletters given a list of letters, display each of the letters
separated by spaces. Use this function when displaying the correct letters list, the
incorrect letters list, and the letters that are remaining list.
getlettersremainingincorrect correct given the list of incorrect
guesses and the list of correct guesses, return the list of remaining letters in the alphabet
to choose from do not display the list from within the function
In your main function, create a loop that repeats until the user chooses to quit. Choose a random
word from the words list this file is provided on Canvas. Include the list by putting from
dictionary import words at the top of your program then create additional lists, one for the
incorrect guesses which starts off empty and the other for the correct guesses starts with
blank spaces Create two counters, one for the number of correct guesses made, and the
other for the number of incorrect guesses. Create a loop that will repeat until the user guesses all
letters in the word, or until the user has made incorrect guesses. Every round, display the
incorrect guesses, the gallows, the correct guesses, the letters remaining, and then prompt the
user to enter their guess. Check to make sure that all user input is valid ie it is a letter AZ and
not a letter theyve already guessed If the guess was correct, add it to the list of correct guesses
in the correct spots if it was not, add it to the list of incorrect guesses and tally the correct or
incorrect guess. Display whether they won or lost, if they lose, show the correct answer.
Example Output:
Hangman
Incorrect selections:
Letters remaining: A B C D E F G H I J
K L M N O P Q R S T U V W X Y Z
Enter a letter: e
Correct!
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
