BMI calculator | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
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 Respostas
+ 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