0
BMI calculator
weight = int(input('')) height = float(input('')) BMI = weight/(height**2) if BMI<18.5: print("underweight") if BMI>=18.5 and BMI<25: print("normal") if BMI>=25 and BMI<30: print("overweight") if BMI>30: print("obesity") #whats my error ⚠️ i couldn't pass the project. It just keeps saying 'try again'
5 Answers
+ 3
You don't need quotes in input() and the result should be capitalized
+ 2
What if input is 30
Don't put anything argument to input() , remove=> ''
edit: also, yes Capitalize first letter for all output, as required in description..
+ 2
I can't thank you enough. You saved me. So all my error was only capitalization i couldn't believe my eyes. Anyways thanks
0
You're welcome 😄
0
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')
else:
print('Obesity')
weight needs to be float