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:
1. display_gallows(num_incorrect) 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, 6 incorrect guesses should show the complete
hanged man).
2. display_letters(letters) 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.
3. get_letters_remaining(incorrect, 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 5
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
5 letters in the word, or until the user has made 6 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 A-Z, and
not a letter theyve already guessed). If the guess was correct, add it to the list of correct guesses
in the correct spot(s), 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!