0
BMi calculator
Hello Guys, please my code is false? height=float(input()) weight=float(input()) result=(weight/(height**2)) if result<18.5 : print("Underweight") elif (result>=18.5 and result<25): print("Normal") elif (result>=25 and result< 30): print("Overweight") elif (result>=30): print("Obesity") or l must do it: height=float(input()) weight=float(input()) result=(weight/(height**2)) if result<18.5 : print("Underweight") elif ( result<25): print("Normal") elif ( result< 30): print("Overweight") elif (result>=30): print("Obesity")
6 Answers
0
Yes you need to first take input for weight, than height,if you look for input for test 1 you will see this:
52
1.85
Weight is in kg, height is in meter.
And weight is intiger, where height is float.
+ 2
Ryan the task recommends integer, but float is maybe a better option after all, because the calculation is in float so Python will have to convert it from int to float anyway.
JSYK, to make it integer you would use the int() function.
Either program should work if you match the order of inputs that the task specifies - weight first, then height.
+ 2
Thank you very much Brian. The program work
0
Hello Brian you said that, l must start declaration by weight before height?
0
why weight is intiger?
weight ca be negative?
0
Please, when l put weight in intiger
NameError: name 'integer' is not defined