Question: Write a Python program which attempts to guess the day of the month you were born. You need to tell the program how many guesses


Write a Python program which attempts to guess the day of the month you were born. You need to tell the program how many guesses are allowed and how many days there are in your birth month. The allowable values the days in your birth month are 28,29,30 and 31. If you enter a number 1 ike 28 , then the program will ask you to try again to enter a correct number of days. The program then uses the randint function to generate a guess. You need to import the "random" Python. hibrary to gain access to randint. When you call randint, the function two arguments separated by a comma. So randlh will qenerate a random integer between 1 and 30. The program gives back it's random gues chen you need to respond with a "1" for "your quess is t. . ", or an "h" meaning that your guess is too "high" or a "c" me ning that the program correctly guessed your day of birth. If the program runs out of guesses (exceeds the number of guesses allowed that you specified) then it prints the fact that it was not successful in guessing your day of birth. Use selection structures (if, elif, else) as needed, Use a "while" loop to validate the month number entered is in the range of 28 to 31. Use a "for" loop for the guesses. There must be a "break" in the loop when the program fails to guess your birth date. Case 2: Success Case -. guessed correctly within guesses allowed: Let's play Guess Your Birthday! Enter max number guesses allowed:10 Enter days in birth month (28,29,30,31):30 My guess is: 20 Enter ' h ' for high, ' 1 ' for low, 'c' for correct:h My guess is: 6 Enter ' h ' for high, ' 1 ' for 10w, 'c' for correct:1 My guess is: 11 Enter ' h' for high, '1' for low, 'c' for correct:1 My guess is: 14 Enter ' h ' for high, ' 1 ' for low, 'c' for correct:h My guess is: 12 Enter ' h ' for high, '1' for low, 'c' for correct:1 My quess is: 13 Enter ' h ' for high, '1' for low, 'c' for correct:a I guessed 13 in 6 guesses! Lab 3 Check List and Grading Points (Rubric) : 10 points total max 1. Name your file fileprefixlab03.py and include header block as shown (1 points) * Name: (your name) \& Course: CS 1160 \# Assignment: Lab 03 \# Date Assigned: 1/30/2023 * Filename: fileprefixlab03.py * Brief Description: Guess a Number Game 2. Use meaningful comments in your program. (2 points) 3. Use meaningful variable names. (2 points) 4. Proper use of input, randint, and break (2 points) 5. Correct and clear use of relational (==,, etc) operators and if-elif-else structures and looping (2 points) 6. Make sure your output is similar to the type of output shown above. You may (and should) do further cases to make sure your program logic is correct (1 points) Outline of code on next page. Additional instructions are in the code outline on how to develop your lab assignment. Submit to Dropbox both a py file and txt file of your code. Put sample output at the bottom of your file starting and ending with triple apostrophes
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
