3.14 and 3.15 Hacks
import math
math.factorial(5)
Hack 1) This code uses the math library to find the factorial of any given number, such as 5
Hack 2) The import function imports a python library, which allows the user to code using pre made functions such as pow, sqrt, or even factorial.
Some other libraries that the user can import include
import math
import flask
import time
Hack 3) What numbers can be outputted from RANDOM(12,20) and what numbers are excluded?
domain: 11<x<21
import random
x = random.randint(1,10)
print(x)
import random
y = random.randint(1,8)
if y == 1 or y == 2 or y == 3:
print("You landed on green")
if y == 4 or y == 5:
print("You landed on blue")
if y == 6:
print("You landed on purple")
if y == 7:
print("You landed on red")
if y == 8:
print("You landed on orange")