BMI calculator | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
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'

21st Apr 2022, 12:43 PM
Tumim Taye
5 Antworten
+ 3
You don't need quotes in input() and the result should be capitalized
21st Apr 2022, 12:53 PM
Рената Ремизова
Рената Ремизова - avatar
+ 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..
21st Apr 2022, 12:52 PM
Jayakrishna 🇮🇳
+ 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
21st Apr 2022, 12:57 PM
Tumim Taye
0
You're welcome 😄
21st Apr 2022, 12:58 PM
Рената Ремизова
Рената Ремизова - avatar
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
12th Jun 2022, 3:38 AM
Nícolas Nascimento
Nícolas Nascimento - avatar