Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- def BMI_FUNCTION():
- height = float(raw_input("What is your height in meters? "))
- weight = float(raw_input("What is your weight in kilograms? "))
- bmi = weight / height**2
- print
- print "Your height is %r meters." % height
- print "Your weight is %r kilograms." % weight
- print
- print "Your BMI is %r" % bmi
- print "BMI Category:",
- if bmi<15.0:
- print "Very severely underweight"
- elif 15.0<=bmi<=16:
- print "Severely underweight"
- elif 16.1<=bmi<=18.4:
- print "Underweight"
- elif 18.5<=bmi<=24.9:
- print "Normal Weight"
- elif 25.0<=bmi<=29.9:
- print "Overweight"
- elif 30<=bmi<=34.9:
- print "Moderately Obese"
- elif 35<=bmi<=39.9:
- print "Severely Obese"
- elif bmi>=40:
- print "Very severely (or morbidly) obese"
- print
- choice = raw_input("Do you want to use the BMI Calculator again? 'Yes' or 'No'? ")
- while choice == 'No':
- print "Thank you for using our BMI Calculator."
- break
- while choice == 'Yes':
- BMI_FUNCTION()
- break
- BMI_FUNCTION()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement