+ 1
Why dont Working?
#your code goes here weight = int(input()) height = float(input()) height = int(height) formul = float(weight/(height**2)) if formul : formul<18.5 print("Underweight") elif formul : formul=18.5 and formul<25 print("Normal") elif formul : formul>=25 and formul<30 print("Overweight") elif formul : formul>=30 print("Obesity")
7 odpowiedzi
+ 3
if formul<18.5:
print("Underweight")
do so with the other values
+ 1
Have you already tried looking for examples via search? Use the search feature for BMI Calculator.
+ 1
Thanks Jayakrishna🇮🇳 it woking 🙏👍
+ 1
Why are you converting height to int, just let it be a float
0
Yes I learn For BMI Chris Coder
0
Oma Falk ouput other value .. ( Obesity) why ?
0
Systax for if statement is like:
if condition :
#if code
elif condition :
# elif code
So as per @Oma Falk, it should like
if formul < 18.5 :
print( "Underweight")
elif formul<25 :
..
..
This is for single case, do the same for other cases..
if formul : #always true, except for 0 value
#formul>=18.5 and formul<25 is a condition, has no effect. Write it as condition for if block condition.
Height should be in float value so dont convert to int.
Hope it helps..