0

Why my code doesn't work?

I don't understand why my code doesn't work. a = int(input()) b = float(input()) res = a / (b * b) if res < 18.5: print ("Underweight") elif res >= 18.5 and < 25: print ("Normal") elif res >= 25 and < 30: print ("Overweight") elif res >= 30: print ("Obesity")

17th Apr 2022, 4:03 PM
ŠŠ¹Ń‚Ń…Š°Š½ Š‘Š°Š·Š³ŠµŠ½Š¾Š²
3 Answers
+ 2
In the 2nd and 3rd elif-condition res is missing: res >= 18.5 and res < 25 res >= 25 and res < 30
17th Apr 2022, 4:28 PM
Lisa
Lisa - avatar
+ 1
Remove 'and' from elif condition
18th Apr 2022, 8:59 AM
Fź«€ā²…įƒ«į„†ĶŸį„™į„‰įƽ
Fź«€ā²…įƒ«į„†ĶŸį„™į„‰įƽ - avatar
0
Thanks!
18th Apr 2022, 4:31 AM
ŠŠ¹Ń‚Ń…Š°Š½ Š‘Š°Š·Š³ŠµŠ½Š¾Š²