Nov-18-2021, 09:27 AM
(This post was last modified: Nov-18-2021, 10:19 AM by Gribouillis.)
Hello
I am new to this forum and programming in general.
I am trying to create BMI calculator. the issue is that no matter what I do the program stops only on the first elif statement (>=18.5 to >=24.9), even if the BMI is higher
code:
I am new to this forum and programming in general.
I am trying to create BMI calculator. the issue is that no matter what I do the program stops only on the first elif statement (>=18.5 to >=24.9), even if the BMI is higher
code:
print('enter you weight kg') weight=float(input()) print('enter you height meter') height=float(input()) BMI=(weight/height**2) print(BMI) if BMI<=18.4: print('You are underweight') elif BMI>=18.5 or BMI<=24.9: print(' You have Normal weight') elif BMI >=25 or BMI<=29.9: print('You are overweight') elif BMI>=30 or BMI<=34.9: print('You are moderately obese') elif BMI >=35 or BMI<=39.9: print('You are severely obese') elif BMI>=40: print('You are very severely obese')Thank you
Gribouillis write Nov-18-2021, 10:19 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.