0
Unknown error in BMI calculator code. How I can fix it???
BMI Calculator code #Unknown error in line 6 weight = float(input('')) height = float(input('')) bmi = weight/(height*height) if (bmi < 18.5): print ('Underweight') elif (bmi >= 18.5 and < 25): print ('Normal') elif (bmi >= 25 and < 30): print ('Overweight') elif (bmi <= 30): print ('Obesity')
4 Respostas
+ 2
hi! try to place all the ifs and elifs in one column strictly under each other. in python, spaces have values
+ 1
after the logical "and" operator, you need to substitute a variable with which you compare the number 25
+ 1
Or use this way:
(18.5 <= bmi < 25)
0
New error, line 5