Hello
I have just started learning Python and I have so many problem in solving my exercise. I know the answer I have written is not correct. Can any body help me?
the question is:
The body mass index (BMI) is calculated as a person’s weight (in pounds) times 720, divided by the square of the person’s height (in inches). A BMI in the range 19-25, inclusive, is considered healthy. Write a program that calculates a person’s BMI and prints a range telling whether they are above, within, or below the healthy range. (20 pts)
I have written:
I have just started learning Python and I have so many problem in solving my exercise. I know the answer I have written is not correct. Can any body help me?
the question is:
The body mass index (BMI) is calculated as a person’s weight (in pounds) times 720, divided by the square of the person’s height (in inches). A BMI in the range 19-25, inclusive, is considered healthy. Write a program that calculates a person’s BMI and prints a range telling whether they are above, within, or below the healthy range. (20 pts)
I have written:
Code:
def bmi_calculate(): weight, height = input("Enter weight and height seperated by a comma:") bmi_calculate = [(weight * 720) / (height * height)] for bmi_calculate in range (19,25): where = 'healthy' if bmi_calculate < 19: where = 'below' elif bmi_calculate > 25: where = 'high' print "your bodey mask index is:" , bmi_calculate
Comment