0

hello i need help i can't find the error i am in python imc calculator exercise

Python exercise

6th Nov 2021, 4:19 AM
Ariel Garcia Aragon
Ariel Garcia Aragon - avatar
6 Antworten
+ 2
I can't find it, I ask to expose the problem here, and your code to detect the error
6th Nov 2021, 4:25 AM
Erlénio.RS
Erlénio.RS - avatar
+ 1
Ariel Garcia Aragon Your code is correct, the only problem is in the output, the words must start with a capital letter. It would be better to also convert these integers (25, 30) to float (25.0, 30.0)
7th Nov 2021, 4:26 AM
Erlénio.RS
Erlénio.RS - avatar
+ 1
#your code goes here weight = int(input()) height = float(input()) result = weight /(height ** 2) if result < 18.5: print("Underweight") elif result >= 18.5 and result < 25.0 : print('Normal') elif result > 25.0 and result < 30.0 : print('Overweight') else : print('Obesity')
11th Nov 2021, 1:46 PM
Erlénio.RS
Erlénio.RS - avatar
0
Tks my english is no good but tks your help weight=int(input()); height=float(input()); bmi= weight/float(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")
6th Nov 2021, 11:50 AM
Ariel Garcia Aragon
Ariel Garcia Aragon - avatar
0
Excuse me, would it be like this? weight=float(input()); height=float(input()); bmi= weight/float(height**2); if bmi<18.5: print("underweight") elif bmi>=18.5 and bmi<25.0: print ("normal") elif bmi>=25.0 and bmi<30.0: print ("overweight") elif bmi>=30.0: print ("obesity")
8th Nov 2021, 1:54 PM
Ariel Garcia Aragon
Ariel Garcia Aragon - avatar
0
pruenba a poner bmi=weight//height**2
1st Jan 2022, 8:01 PM
Iraitz
Iraitz - avatar