28 lines
644 B
Python
Raw Normal View History

2021-04-19 22:35:25 +00:00
def add(a, b):
print(f"ADDING {a} + {b}")
return a + b
def subtract(a, b):
print(f"SUBTRACTING {a} - {b}")
return a - b
def multiply(a, b):
print(f"MULTIPLYING {a} * {b}")
return a * b
def divide(a, b):
print(f"DIVIDING {a} / {b}")
return a / b
print("Let's do some math with just functions!!")
age = add(30, 5)
height = subtract(75, 3)
weight = multiply(60, 3)
iq = divide(200, 2)
print(f"Age: {age} \nHeight: {height} \nWeight: {weight} \nIQ: {iq}")
#extra credit
print("Here is a puzzle")
what = add(age, subtract(height, multiply(weight, divide(iq, 2))))
print(f"The what variable is equal to: {what}")