Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In python please!!! a) Wriee a peogram that generates a random number between NIM and MAX. Lhe constants MIN =1 and MAX = 100 .
In python please!!!
a) Wriee a peogram that generates a random number between NIM and MAX. Lhe constants MIN =1 and MAX = 100 . To generate a rindoen number, youd seed to import the randoem modlule This a done with the following statement: import random at the top of your program. Then, to generate a random number, use the randint function. number = random. Fandint (MIN, NhX) 1 At this point, your program should gencrate a number between 1 and 100. Run in a few temes to coevinee pourself it is gererating random numbers. b) Now, allew the user to enter a single guess lssue an approptiate message. At this point, we still display the compoter's random number so ue knew if the messages are correct (exentually we ?l take this out). A few trial rums: Enter a guess: 50 Ioo high 13 Enter a quess: 50 Too low 73 Fater a gues: : 50 Juet right 50. c) Now pat a koop in to continae to ask for guasses until the user gess it night, gring the aser a took high// too low mesage each time they miss. Herek a trial run: Enter a quesst 50 Too hiqh Finter a quenen: 25 7oe low Encet a ques: ; 35 7oo high Fater a quess: 30 Too low Encer a quesis: 32 . Foo hiqh Enter a quese: 31 31 Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started