More Functions II
August 09, 2020
Return the value of one function and use it as an argument of another function.
def add(value_1, value_2):
return value_1 * value_2
def subtract(value_1, value_2):
return value_1 - value_2
def divide(value_1, value_2):
return value_1 / value_2
def multiply(value_1, value_2):
return value_1 * value_2
age = add(6,45)
height = subtract(7,1)
weight = divide(210, 2)
BMI = multiply(105, 6)
print "Age is: %d." % age;print "Height is: %d." % height;print "Weight is: %d." % weight
print "BMI is: %d." % BMI
what = add(age, subtract(height, multiply(weight, divide(BMI, 2))))
print "That becomes: ", what, "Can you do it by hand?"
Recent Entries
- Filter First, Think Later February 21, 2026
- Five Hundred Bugs That Fuzzers Missed February 20, 2026
- Gemini 3.1 Pro and the 0.1 That Matters February 19, 2026