+ 1

Hello. Can you help me identify what's wrong in my code? I tried using elif but it also doesn't work.

THIS IS FOR THE BMI CALCULATOR. This code prints correct during 1st test case which is the Underweight but outputs "No output" during the second test case which is the Obesity. x = int(input()) #weight y = float(input()) #height z = x/y**2 if (z < 18.5): print("Underweight") if ((z >= 18.5) and (z < 25)): print("Normal") if ((z >= 25) and (z < 30)): print("Overweight") if (z >= 30): print("Obesity")

25th Mar 2021, 4:10 PM
Kathleen Gabitan
Kathleen Gabitan - avatar
2 Answers
+ 2
visph okay I'll try editing my code. Thank you for your response! Happy coding and learning!
25th Mar 2021, 4:16 PM
Kathleen Gabitan
Kathleen Gabitan - avatar
0
if condition1: # statements elif condition2: # statements elif ...
25th Mar 2021, 4:13 PM
visph
visph - avatar