forked from dominict/pythonteachingcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions_play.py
More file actions
19 lines (15 loc) · 533 Bytes
/
Copy pathfunctions_play.py
File metadata and controls
19 lines (15 loc) · 533 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
'''
This is a file full of functions examples.
'''
def calculate_bmi(height, weight, units="standard"):
'''
This function calculates BMI and returns the value. It expects height in inches and weight in pounds.
Change units to metric if metric. Then input KG and Meters.
'''
if units == "standard":
bmi = (weight/(height*height))*703
else:
bmi = weight/(height*height)
return bmi
print("standard case: ",calculate_bmi(62,138))
print("metric case: ",calculate_bmi(1.575,62.596,"metric"))