BMI Calculator¶

Please note that BMI “is not a true diagnostic of body fatness or of an individual’s overall health”. It has severe flaws. See the article Is BMI an Accurate Way to Measure Body Fat?.

The body mass index (BMI) is commonly used by health and nutrition professionals to estimate human body fat in populations.

It is computed by taking the individual’s weight (mass) in kilograms and dividing it by the square of their height in meters.

Name the file:

bmi_calculator.py

Sample Output¶

Height in m: 1.75
Weight in kg: 73

The BMI is 23.83673

Bonus #1 - Imperial Measurements¶

For +10 bonus points, input their weight and height using pounds and inches, and convert to kilograms and meters to figure the BMI.

Height in inches: 69
Weight in pounds: 160

The BMI is 23.625289

For an extra +3 bonus points (+13 total), input their height in feet and inches.

Height (feet only): 5
Height (inches): 9
Weight in pounds: 160

The BMI is 23.625289

©2021 Daniel Gallo

This assignment is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.

Creative Commons License

Adapted for Python from Graham Mitchell’s Programming By Doing