0

The last print statement of this code is not working. Kindly Help?

#your code goes here weight=int(input()) height=float(input()) BMI=weight/((height)**2) if BMI < 18.5: print("Underweight") if BMI>= 18.5 and BMI < 25 : print("Normal") if BMI >=25 and BMI < 30: print("Overweight") if BMI >=30 : print("Obesity")

21st Mar 2021, 8:05 AM
Amit Kumar
Amit Kumar - avatar
2 odpowiedzi
+ 2
That's cuz.. your "if" statements are used inside others "if statements. So, your second "if" will not execute if first "if" returns "false". So, the only thing you have to do - delete extra spaces
21st Mar 2021, 8:10 AM
Nazeekk
Nazeekk - avatar
0
thanxx...
21st Mar 2021, 8:17 AM
Amit Kumar
Amit Kumar - avatar