Python problem in BMI [solved] | Sololearn: Learn to code for FREE!

+1

Python problem in BMI [solved]

Code not working if any one can help me BMI weight = str(input()) hight = float(input()) bmi = weight/(hight * hight) if bmi < 18.5: print ('Underweight') elif bmi >= 18.5 and bmi < 25: print ('Normal') elif bmi >= 25 and bmi < 30: print ('overweight') elif bmi > 30: print ('Obesity')

9/27/2021 2:01:21 AM

Lz1234

7 Answers

New Answer

+4

Hi Lz1234! str() is used to return the string. But you can't use strings for arithmetic operations. For that, you can use int() or float() for weight variable to convert it to an integer or float.

+2

Apart from what was already mentioned, to pass the test cases it has to be "Overweight" instead of "overweight" and the last condition has to be ">=30" instead of ">30".

0

Thanks

0

Mia Read the other answers thay already found the problom

0

My mistake. Thanks

0

No problom

-1

This code doesn't work. I tried.