[Tutor] BMI calc

Soliman, Yasmin ysoliman at uncc.edu
Wed Mar 13 01:05:36 CET 2013


Hello all,

I'm new to python and its been a stuggle so far. I'm attempting to create a BMI calculator in Wing 101 4.1. I keep getting syntax errors:

def calc_BMI(weight,height):
    return (weight/(height*height))*703.0
if bmi <=18.5:
    print 'underweight'
elif bmi >= 18.5 and bmi <=24.9:
        print 'normal weight'
elif bmi >=25 and bmi <=29.9:
            print 'overweight'
elif bmi >=30:
                print 'obese'

Also, height should be converted to inches and I have not the slightest clue how to so. Any help would be much appreciated. 


More information about the Tutor mailing list