Skip to content

Commit

Permalink
Adding functions examples file
Browse files Browse the repository at this point in the history
This is just an extra demo file.
  • Loading branch information
dominict committed Apr 22, 2024
1 parent 0280ac0 commit d97f959
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions functions_play.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,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"))

0 comments on commit d97f959

Please sign in to comment.