Question: in python Problem 3 Below is a program that will promote the user to guess a randomly selected lowercase letter Run It a few times
in python
Problem 3 Below is a program that will promote the user to guess a randomly selected lowercase letter Run It a few times to familiarize yourself with the way that a works. After you are familiar, modify the program to only allow the user to guess up to 8 times before the program finally terminates. The end product should run like the following example Expected Output The user needs to guess Please guess my lowercase letter Wrongl Try again Please guess my lower casetter Wrong! Try again Please guess my lower case letter Wrong! Try again Please guess my lower case letter.d Wrong! Try again! Peguess my lower cantor Wrong! Try again Pane guess my lowercase letter! Wrong! Try again Please guess my lower cane letter Wrong! Try again Please guess my lower case letter Sorry, you did not guess the other was thinking of I was thinking of the letter End Output at waypoint they guess the letter correctly, the following message should print and the program should stop Great You Are If at anypoint they guess the letter correctly, the following message should print and the program should stop. Great! You are right! In 1]: . guess the randomly chosen character this is a library - we'11 learn more about this later import random alphabet = 'abcdefghijklmnopqrstuvwxyz' #Initialize the alphabet answer - random.choice(alphabet) #Pick a letter randomly print("The user needs to guess:", answer) so we know ... guess - input('Please guess my lower case letter:') while guess 1 answer If the user's answer is not right, repeat the statements print('Wrong! Try again!') guess - input('Please guess my lower case letter:') Why is there no if statement ? print('Great! You are right!)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
