+ 1
There is a condition statement keyword know as else if in short (elif) in python, use that
31st May 2022, 5:39 PM
Faisal Issaka
Faisal Issaka - avatar
+ 1
Conditions are read from left to right, just like in a math problem. In the second if, python will read for "peso >= 18.5" to be true if the weight is in fact over that, but then python will read "true != 24.9" which I think you didn't want. But if you do "18.5 <= peso < 24.9" you will get what you want. Also, use elif like Faisal mentioned instead of else if: besides not having to indent every time, it looks much cleaner.
31st May 2022, 6:55 PM
João Gonçalves