Lesson 3.14 3.15 hack
import math
math.comb(12,10)
import math
num = input("what number do you want to square root?")
squart = math.sqrt(int(num))
print("The root of",num,"is",squart)
Hack 3.15.2
- For your hacks you need to create a random number generator that will simulate this situation:
-
There is a spinner divided into eight equal parts. 3 parts of the spinner are green, two parts are blue, one part is purple, one part is red, and one part is orange. How can you simulate this situation using a random number generator.
-
Also answer this question: What numbers can be outputted from RANDOM(12,20) and what numbers are excluded?
- It's any number greater than or equal to 12 and less than or equal to 20.
import random
landed_on = random.randint(1,10)
if landed_on <= 4:
color = "rice"
elif 4<= landed_on <= 6:
color = "noodle"
elif landed_on == 7:
color = "fruit"
elif landed_on == 10:
color = "pizza"
print("The food is", color)