Skip to content

Instantly share code, notes, and snippets.

@claudinec
Created January 4, 2016 01:51
Show Gist options
  • Save claudinec/8d130232708974e452a8 to your computer and use it in GitHub Desktop.
Save claudinec/8d130232708974e452a8 to your computer and use it in GitHub Desktop.
bmi.py
#!/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