New course! Every coder should learn Generative AI!
Try a free lesson+ 2
My bmi calculator is ok but why this app not accepting my test of bmi calculator?
11 Answers
+ 4
# Mistakes
# 1. weight = float(input())
# 2. BMI = weight / height**2
# 3. No mistake found 😂
# Correction
# Try this code out
weight = float(input())
height = float(input())
bmi = weight / (height ** 2)
if bmi < 18.5:
print('Underweight')
elif bmi >= 18.5 and bmi < 25:
print('Normal')
elif bmi >= 25 and bmi < 30:
print('Overweight')
elif bmi >= 30:
print('Obesity')
+ 4
The new end of module challenges look for exact outputs so don't have any unspecified prints (outputs).
+ 4
We're usually advised not to post exact solutions.
+ 3
Please post your try / code here!!
So that I can find mistakes for you to figure out
+ 3
weight=int(input())
height=float(input())
BMI=weight/height**2
print(BMI)
if BMI<18.5:
print ('Underweight')
elif BMI >=18.5 and BMI<25:
print('Normal')
elif BMI>=25 and BMI<30:
print('Overweight')
elif BMI>=30:
print('Obesity')
+ 2
This plz
+ 2
Remember, Python is a case sensitive language
+ 2
I think the error was that you were printing the BMI value.
+ 1
What is mistake in my code?
+ 1
My code's only mistake is that BMI is in capital whereas they aceppt it as bmi🙄🙄😡
+ 1
bmi = float(input())/float(input())**2
if bmi<18.5:print('Underweight')
elif 25>bmi>=18.5:print('Normal')
elif 30>bmi>=25:print('OverWeight')
elif bmi>=30:print('Obesity')