Lowest price ever! Learn Generative AI for 48% less!
Get my discount0
In the bmi calculator module i got stucked
weight=input("input your weight:") height=input("input your height:") bmi=float(weight)/(float(height))**2 print(bmi) if float(bmi) <18.5: print("Underweight") elif 18.5<=float(bmi)<25: print("Normal") elif 25<=float(bmi)<30: print("Overweight") elif float(bmi)>30: print("Obesity") Please tell me where is the bug
10 Answers
+ 3
This is the correct code. Your logic is correct the only thing is you don't need to give information to the user. That's all
+ 2
ayushman halder
This maybe helps you :
#your code goes here
weight = int(input());
height = float(input());
bmi = weight/float(height*height);
if bmi<18.5:
print('Underweight')
elif bmi>=18.5 and bmi<25:
print("Normal")
elif bmi>=25 and bmi<30:
print('Overweight')
else:
print('Obesity')
+ 2
kachi As mentioned earlier posting direct answers is prohibited. If you are posting direct answers also use comments in your code for explanations
+ 1
#In the bmi calculator module i got stucked
weight=input()
height=input()
bmi=float(weight)/(float(height))**2
if float(bmi) <18.5:
print("Underweight")
elif 18.5<=float(bmi)<25:
print("Normal")
elif 25<=float(bmi)<30:
print("Overweight")
elif float(bmi)>30:
print("Obesity")
#Please tell me where is the bug
+ 1
My pleasure
+ 1
I don't know if this is what you need the program to do
height=float(input("enter height"))
weight=float(input("enter you weight"))
BMI=weight/(height*height)
bMI=float(BMI)
print(bMI)
if bMI<18.5:
print("underweight")
elif bMI>=18.5 or bMI<25:
print("normal")
elif bMI>=25 or bMI<30:
print("overweight")
if bMI>=30:
print("obesity")
+ 1
This is the correct one
height=float(input("enter height"))
weight=float(input("enter you weight"))
BMI=(weight/height)*height
print(BMI)
if BMI<18.5:
print("underweight")
elif BMI>=18.5 or BMI<25:
print("normal")
elif BMI>=25 or BMI<30:
print("overweight")
if BMI>=30:
print("obesity")
0
Thanks Atul ....☺
0
Ok I will do that next time
0
Where is it stated pls