0

Pls help to find out the problem

#your code goes here w = int(input ()) h = float(input ()) bmi = float (w / h**2) if bmi<18.5 : print ("Underweight") elif 18.5=>bmi<25 : print ("Normal") elif 25=>bmi<30 : print ("Overweight") else 30=>bmi : print ("Obesity")

21st Sep 2021, 4:56 AM
bishal sheikh
bishal sheikh - avatar
3 Answers
+ 2
Mistakes: 1. it's >= not => 2. u can't use condition on else statement for that u can use elif code: w = int(input ()) h = float(input ()) bmi = float (w / h**2) if bmi<18.5 : print ("Underweight") elif 18.5>=bmi<25 : print ("Normal") elif 25>=bmi<30 : print ("Overweight") elif 30>=bmi : print ("Obesity")
21st Sep 2021, 5:12 AM
Pariket Thakur
Pariket Thakur - avatar
+ 1
But wrong logic is applied in conditions. They need to be like this num1 <= bmi < num2:
21st Sep 2021, 5:38 AM
Python Learner
Python Learner - avatar
0
Thanks
21st Sep 2021, 5:16 AM
bishal sheikh
bishal sheikh - avatar