3.14 and 3.15 Hacks
These are my 3.14 and 3.15 Hacks.
import math
math.sqrt(121)
This is an example of a code that uses libraries. I used this example because I am really good at math. For the following code, the output of it is 11 because the square root is 121 is 11.
import random
print("How many family members will I visit for Christmas")
randomnumber = random.randint(0,100)
print("You will visit ", randomnumber, " families for Christmas")
An input random function can import code from another source that contains randomization.
The import function can import things other than random such as flask, NumPy, and pandas.
import random
colorspinner = random.randint(1,8)
if colorspinner <= 3:
print("green")
elif colorspinner <= 5:
print("blue")
elif colorspinner <= 6:
print("purple")
elif colorspinner <= 7:
print("red")
else:
print("orange")
RANDOM(12,20) can output numbers 12, 13, 14, 15, 16, 17, 18, 19, & 20. Numbers greater than 20 and numbers less than 12 are excluded.