Question: Write a program that has the user guess a special word in three tries. The special word has been given to you Prompt the user
Write a program that has the user guess a special word in three tries. The special word has been given to you
Prompt the user to input their guess. Enter your guess: and make it lowercase.
If the user guesses correctly, print Correct! You got it in number of tries tries! Remember that you can exit a loop early by using the break keyword
If they dont get it right, do the following:
print Sorry. That is incorrect. You have number of tries tries left..
If the users guess is longer than the correct word, tell them: Hint: Your guess is too long If their guess is shorter than the correct word, tell them: Hint: Your guess is too short. And if their guess and the correct word are the same length, tell them: Hint: Your guess is the correct length
Make steps happen in a loop until the user guesses correctly OR until they use up all tries
If the user doesnt guess correctly in three tries, print Game over! The correct word is secret word
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
