Created
January 4, 2016 01:51
-
-
Save claudinec/8d130232708974e452a8 to your computer and use it in GitHub Desktop.
bmi.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Calculate Body Mass Index. | |
BMI = mass (kg) / height (m) ^ 2 | |
Mass and height must be numbers. | |
""" | |
mass = raw_input('Mass (kg) ') | |
height = raw_input('Height (m) ') | |
bmi = float(mass) / float(height) ** 2 | |
print 'Your BMI is ' + str(bmi) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment