subject
Engineering, 29.03.2021 06:00 FavvBella84

You do not need to use or create any user-defined functions in this program You need to import random, time, math libraries
You need to use time, sleep 0, candom. randrange (), math. sgrt () and
rath. pou () functions (see examples from handout from week 4 and 5)
Prompt the user for a number (float)
Use that number to output for things using built-in Python functions:
Sleep (pause) for that many seconds
Output a random number between 1 and the number entered by the user
o Output the square root of the number entered by the user
o Output the result of the number entered by the user to the power of 2
Your output should look like the same run below (but should allow for user input of the number)
Sample Run (based on user input of 4)
Please enter a number: 4
Sleeping for 4.0 seconds
Random number is: 2
The square root of 4,0 =2.0
4.0 to the power of 2 = 16.0

ansver
Answers: 1

Other questions on the subject: Engineering

image
Engineering, 04.07.2019 18:10, niicoleassssssf
Aflywheel accelerates for 5 seconds at 2 rad/s2 from a speed of 20 rpm. determine the total number of revolutions of the flywheel during the period of its acceleration. a.5.65 b.8.43 c. 723 d.6.86
Answers: 2
image
Engineering, 04.07.2019 18:10, anna22684
Water at 70°f and streams enter the mixing chamber at the same mass flow rate, determine the temperature and the quality of the exiting stream. 0 psia is heated in a chamber by mixing it with saturated water vapor at 20 psia. if both streams enters the mixing chamber at the same mass flow rate, determine the temperature and the quality of the existing system.
Answers: 2
image
Engineering, 04.07.2019 18:20, rocio5649
Amixture of slurry and mud is to be pumped through a horizontal pipe of diameter 500 mm. the fluid behaves as a bingham plastic with a yield stress of 30 pa and viscosity 0.04 pa. s. describe the effects of the shear stress through a transverse section of the pipe by plotting the variation in shear stress and velocity profile: (i) just before the slurry starts to move (ii) as the slurry flows when the pressure gradient is double that in part (i)
Answers: 3
image
Engineering, 04.07.2019 19:10, justkevin1231
Which of the following is the most important advantage of a large field of view? a. allows larger areas to be examined b. relieves eyestrain c. minimizes parallax errors. d. increases precision in proportion to the in- crease in field of view
Answers: 2
You know the right answer?
You do not need to use or create any user-defined functions in this program You need to import rand...

Questions in other subjects:

Konu
Mathematics, 14.12.2020 21:10