0

Help me please

i'm going through python and i've been sitting on the bmi calculator level for almost a day, can anyone help me, here is my code weight = int(iput()) growth = int(input()) if weight < 18.5: print("Underweight") if 18.5 < weight < 25: print("Normal") if 25 < weight < 30: print("Overweight") if 30 < weight: print("Obesity")

7th Sep 2022, 5:32 PM
13Ń‚Ń€ĐŸŃ…Đ°
13Ń‚Ń€ĐŸŃ…Đ° - avatar
2 Answers
+ 4
In addition to the accepted answer, you should convert your input to a float rather than an int so that the decimals don't get removed. Also, Python does allow expressions such as 18.5 < weight < 25, but it's very uncommon in other languages and some people consider it bad practice, so I agree that the "and" operator should be used instead.
7th Sep 2022, 6:24 PM
Daniel C
Daniel C - avatar