Question: Knightro wants to implement a combination lock. However, he is having trouble figuring out what numbers he will use. He wants to generate a random

Knightro wants to implement a combination lock. However, he is having trouble figuring out what numbers he will use. He wants to generate a random number between 10 and 99, inclusively.
import random
first_number = random.randint(
,
)
Flag question: Question 2
Question 21 pts
Knightro is planning on reporting Petey for harassment. He has written the following code to give the average time in between the times Petey has bothered him.
import math
total =(min1+min2+min3)/3
However, he wants to embellish how bad it is by rounding the total down to the next integer. Using the math library, how would he do this? He wants to save the value in the variable, total.
Flag question: Question 3
Question 31 pts
Now, Knightro wanted to add two layers of complexity to discourage Petey. He wants to take a random number from 50-500 and save it as a variable named number. He then wants to create another line of code that will take the square root of that number, and then rounds it up to the next integer, and saves it as the variable ans.
import math
import random
You must use randint in line1, and the math library in line 2.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!