Answered step by step
Verified Expert Solution
Link Copied!

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!!!
image text in transcribed
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

T Sql Fundamentals

Authors: Itzik Ben Gan

4th Edition

0138102104, 978-0138102104

More Books

Students also viewed these Databases questions

Question

How to solve maths problems with examples

Answered: 1 week ago