- 1
Bmi
#My code h = float(input()) w = float(input()) x = w / (h*h) if x < 18.5: print ("Underweight") elif (x >= 18.5 and x < 25): print ("Normal") elif (x >= 25 and x< 30.0): print ("Overweight") elif x > 30: print ("Obesity") Pass 1 test, but other not. What the wrong?
4 Respostas
+ 5
Yes !
First the weight should be taken as input and then height ..
This is because the input is given by the app itself it doesn't knew how to provide input in order .
So, it is we who have to take care !
Moreover,
One more technique which can be used here is swapping the Values of h and w Variables when h > w ..
This is because we practically knew that weight is always greater in value when compared with height !
+ 4
I have never done this before.
It would be better if you provide the description.
Maybe you have to take input weight first and then height.
+ 1
ch Murali thanks, it’s rly work
0
No problem ^_^ Sasha Sch
keep learning !