Write a program called p3.py that prints out a classic hangman stick figure. The program should ask the user to enter a number from 1-6 and the corresponding hangman should be printed. The value the user inputs corresponds to the number of incorrect guesses in a real hangman game and so the completeness of the hangman will correspond to the number of ‘incorrect guesses’ inputted by the user (e.g., if the user enters 1, then only the head of the hangman will be printed; full example below). Example: Enter a number from 1-6: 1 O Enter a number from 1-6: 2 O | Enter a number from 1-6: 3 O \| | Enter a number from 1-6: 4 O \|/ | Enter a number from 1-6: 5 O \|/ | / Enter a number from 1-6: 6 O \|/ | / \ Feel
Write a
Example:
Enter a number from 1-6: 1
O
Enter a number from 1-6: 2
O
|
Enter a number from 1-6: 3
O
\|
|
Enter a number from 1-6: 4
O
\|/
|
Enter a number from 1-6: 5
O
\|/
|
/
Enter a number from 1-6: 6
O
\|/
|
/ \
Feel
We need to create the program according to the given output for the hangman in python.
Step by step
Solved in 4 steps with 2 images