0

Error creating a BMI Calculator in Python.

Hello everyone! I'm a begginer in Python. I have created a program to make a BMI calculator at Control Flow lesson's code project . But it says error. Can you tell me what's the problem here? - weight=int(input()) height=int(input()) BMI=weight/height**2 if BMI<float(18.5) print('Underweight') BMI>=float(18.5)<25 print('Normal') BMI>25<30 print('Overweight') BMI>=30 print('Obesity')

14th Jul 2021, 5:24 AM
Mahmudul Hasan
Mahmudul Hasan - avatar
2 Answers
+ 6
Just this code 👇 weight=int(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") else: print("Obesity")
14th Jul 2021, 5:35 AM
Sâùtôsh
Sâùtôsh - avatar
+ 2
Thank you so much everyone.
14th Jul 2021, 6:59 AM
Mahmudul Hasan
Mahmudul Hasan - avatar