0
BMI Calculator
Could You tell me what I have done wrong and help me solve this task correctly, please? #your code goes here weight = int(input()) height = float(input()) bodyMassIndex = print(float(weight/(height*height))) if bodyMassIndex < 18.5: print ("Underweight") elif 18.5 <= bodyMassIndex < 25: print ("Normal") elif 25 <= bodyMassIndex < 30: print ("Overweight") else: print ("Obesity")
5 Respostas
+ 9
bodyMassIndex = float(weight/(height*height))
+ 2
Jonathan P. Jundarino no need of indentation as blocks are inlined and with only one statement ;)
0
bodyMassIndex = print(float(weight/(height*height)))
why here the need of print function? Just use
bodyMassIndex = float(weight/(height*height))
if any error still, then check spelling of output statements once..
0
#your code goes here
Height = int(input())
Weight = float(input())
BMI = (Weight)/(Height) **2
if BMI <18.5:
print('Underweight')
elif BMI >= 18.5 < 25:
print('Normal')
elif BMI >= 25 < 30:
print('overweight')
else:
print('Obesity')
Please what is wrong with my code