0

why is this wrong, i have been trying to figure it out for 2 days.(26 in the python course)

x = input() y = input() z = (x / (y ** 2)) if (z < 18.5): print ("Underweight") elif (z >= 18.5 and z < 25): print ("Normal") elif (z >= 25 and z < 30): print ("Overweight") elif (z >= 30): print ("Obesity")

7th Oct 2022, 7:09 AM
Lenn
Lenn - avatar
2 Answers
+ 4
Use x= float(input()) y=float(input())
7th Oct 2022, 7:56 AM
Venkatesh
Venkatesh - avatar
+ 3
I am not sure about the exact breaking points for the classification, but for now you are taking input as string, not as a numeric type. Prefix the calls to input() with a float() for conversion: x = float(input())
7th Oct 2022, 7:51 AM
Ani Jona 🕊
Ani Jona 🕊 - avatar