BMI CALCULATOR | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

BMI CALCULATOR

Help me find my error in my BMI CALCULATOR code This what I wrote: weight=float(input()) height=float(input()) BMI=weight/(height**2) if BMI<18.5: print("Underweight") elif BMI>=18.5 and BMI<20: print("Normal") elif BMI>=20 and BMI<30: print("Overweight") elif BMI>=30: print("Obesity") Advance Thank you!

6th May 2021, 2:52 PM
Sushane Vendiola
Sushane Vendiola - avatar
7 Answers
+ 7
See there's just a small mistake and that's in line 6 and 8 . There u have to write 25 instead of 20. weight=float(input()) height=float(input()) BMI=weight/(height**2) if BMI<18.5: print("Underweight") elif BMI>=18.5 and BMI<25: print("Normal") elif BMI>=25 and BMI<30: print("Overweight") elif BMI>=30: print("Obesity")
6th May 2021, 3:22 PM
Kǟrɨsɦmǟ ❥
Kǟrɨsɦmǟ ❥ - avatar
+ 3
I already changed the whole code and the new one worked!
6th May 2021, 3:00 PM
Sushane Vendiola
Sushane Vendiola - avatar
+ 1
Ok nice
6th May 2021, 3:00 PM
YUGRAJ
+ 1
Thank you❤️
6th May 2021, 3:27 PM
Sushane Vendiola
Sushane Vendiola - avatar
+ 1
Sushi Try this: #your code goes here weight = int(input()); height = float(input()); bmi = weight/float(height*height); if bmi<18.5: print('Underweight') elif bmi>=18.5 and bmi<25: print("Normal") elif bmi>=25 and bmi<30: print('Overweight') else: print('Obesity')
7th May 2021, 12:42 AM
❤️😍Prerana😍❤️
❤️😍Prerana😍❤️ - avatar
0
It is working fine what's wrong?
6th May 2021, 2:55 PM
YUGRAJ
0
there's some errors in that code.
6th May 2021, 2:59 PM
Sushane Vendiola
Sushane Vendiola - avatar