Question: Write a word guessing game in Python as follows: 1. The program will ask Player 1 for a word that is five characters or more.

Write a word guessing game in Python as follows:

1. The program will ask Player 1 for a word that is five characters or more.

a. If the word has fewer than 5 characters or if the word contains something other than letters, the program will continue to repormpt until a word 5+ letters is given.

2. The program will then print 50 blank lines - essentially clearin gthe screen.

3. The program will tell Player 2 how many letters make up Player 1's word and will prompt Player 2 for a guess.

4. Player 2 now has 10 guesses to guess the Player 1's word:

a. The program will prompt Player 2 to enter a word to guess:

i. Player 2's guess must be 5 letters or more. If player 2 enters fewer than 5 letters (or their guess contains things that are not letters), an error message will appear and they will be reprompted for a good input. An attempt is NOT taken away if Player 2 provides a guess with fewer than 5 letters or enters a guess that contains things that are not letters.

b. If player 2's guess does not match Player 1's guess (regardless of case), the program tells Player 2 that they were incorrect.

i. The program tells Player 2 that they did not guess correctly.

ii. The program takes a guess away and tells Player 2 how many more guesses that they have remaining.

5. The game ends if Player 2 guesses Player 1's word OR if all 10 guesses are used:

a. If player 2 guessed Player 1's word (regardless of case) in the 10 attempts:

i. A "congratulations" message is printed to the screen

ii. Player 1's secret word is shown.

b. If all 10 guesses are used before Player 2 guesses the word, Player 2 has lost:

i. A "sorry" message is printed to the screen.

ii. Player 1's secret word is revealed.

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 Databases Questions!