# simple BMI calculator # # note how we wrote this program by looking at input # first, then process (algorithm), and then output. # also, we wrote the major steps of the program first # as comments, and only then filled in the actual missing # Python code - thereby automagically documenting our # program in the process! # # other noteworthy items: # - we state units of input # - deal with potential truncation! # - format the output # # written by e.bonakdarian oct 2010 # # ask user for height and weight height = input('Please enter your height in inches: ') weight = input('Please enter your weight in pounds: ') # compute bmi bmi = (weight * 703.0) / (height ** 2) # display bmi print 'The bmi is: %.1f' % bmi