Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This program must be created in Python and cannot use def functions except for def main. Please help thanks! PBUILD&PLAY THE HANGMAN GAME Write a

This program must be created in Python and cannot use def functions except for def main. Please help thanks! image text in transcribed
image text in transcribed
PBUILD&PLAY THE HANGMAN GAME Write a program (hagman.pyl thar plays he hangman gane wth a user Phase 1 The program w" nitule a hangnansez to a sentence of your daice (e"z 1 ve Python"], how to the user the seczet form of the original sentence (vee example belowl, where all non-whitespace and non-punctuation characters are replaced by underscores and prompt the uver for a letter Phase 2 Look at the md ofthe description" You need to make sure that se steps for Phase properly before you continue to Phaie 2 are woring Assuming that the hang nan sentence "I love python--the following wil be presented to the user. if the letter iin the hangaanstr, your program uhould ouput ofter every uwr guess the folowing information: number of times the letter appears in the thing, 29 the updated secret St-+where the p underscorels will be replaced by the letter the user successully found and 3) the lst of letters already picked by For example, if user guwessed letter the eliowing will occur If the user puesses incoreectly, the program should output the next body-part from the bedyparts ist (se below) thatr is added to the hangman It should aso print: 1) the current status of the secretSte (with the letters fourd so far) and 21 the ist of letters already picked by the user For example, if the user guessed letter she folowine will oour the hanman Nobe: Ii the user picks a letter already guessed before, the program should output the proper message as shown e geessed that letter aleeady Ths contiues unel eleher af two things Mappen the user puesses all the letters corectly ar the nems from the hangman bodyparta st ane l used la the game: For example, if the complete hagmanSte sguessed corvectly, the fisal ourput will be Otherwise, Ethe bodyparts list is used up then the output will be Sotey. You Lose More Rules This game will net be case-sensitive, so, d users puess is"or"1", the result should be the same - The hangman string has to be a complete sentence le: I love python You may use arry S int and lis1 method dscussed in class to write this code. Implementation Details & Hints. at isutoyou to decide seeret wdbeastring oralist ofcharacter1inyour code inboth cases, initially all characters in secret will be underscones and will be gradualily replaced by the nespective comect guesses b)useth, following list to keep track of the body parts. Left eye "right eye"mouh eck Create an Lndex to keep track at the body parts used so far whenuser guesses an incorrect letter, output the value in bodyPartsindex1 and increment the Lndex value by ) You should run this code in awhe-loop which will berminate when elther hanmanSt gused correctly or the complete hangman has been created. 4) Make sure you are only dealing with the ephabebical letters in the hangman sentence and are not

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Machine Performance Modeling Methodologies And Evaluation Strategies Lncs 257

Authors: Francesca Cesarini ,Silvio Salza

1st Edition

3540179429, 978-3540179429

More Books

Students also viewed these Databases questions

Question

What is meant by planning or define planning?

Answered: 1 week ago

Question

Define span of management or define span of control ?

Answered: 1 week ago

Question

What is meant by formal organisation ?

Answered: 1 week ago