How to code and create this bmi calculator | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to code and create this bmi calculator

Tracking your BMI is a useful way of checking if you’re maintaining a healthy weight. It’s calculated using a person's weight and height, using this formula: weight / height² The resulting number indicates one of the following categories: Underweight = less than 18.5 Normal = more or equal to 18.5 and less than 25 Overweight = more or equal to 25 and less than 30 Obesity = 30 or more Let’s make finding out your BMI quicker and easier, by creating a program that takes a person's weight and height as input and outputs the corresponding BMI category. Sample Input 85 1.9 Sample Output Normal https://code.sololearn.com/cMLs4sEdU3y6/?ref=app

17th Mar 2021, 3:16 PM
Jay Bhamare
Jay Bhamare - avatar
2 Answers
+ 6
share your coding attempt to be helped ;P
17th Mar 2021, 3:25 PM
visph
visph - avatar
+ 1
weight = int(input()) height = float(input()) bmi = weight / ( height * 2) # <- should use ** here, so height ** 2 if bmi < 18.5: print("Underweight") elif bmi < 25: print("Normal") elif ... else: ...
17th Mar 2021, 5:13 PM
Russ
Russ - avatar