0
What is the difference of these two code? Firsi one didnt work
weight = float (input ()) hieght = float (input ()) BMI = weight / (hieght ** 2) if BMI < 18.5 : print ("underweight") elif 18.5 =< BMI and BMI < 25 : print ("Normal") elif 25 =< BMI and BMI < 30 : print ("overweight") else : print ("Obesity") x = float (input ()) y = float (input ()) p = x / (y**2) if p < 18.5 : print ("low") elif p >= 18.5 and p < 25 : print ("med") elif p >= 25 and p < 30: print ("high") elif p >= 30 : print ("very high")
8 RĂ©ponses
+ 3
Hi Hamed Rahimyan
Difference between the 2(by me)
1.Else is not in second code(that is not nice)
2.Variables are different (noticable)
3.Program output is different (obvious)
4.Program style is same but slightly different (because of else statement)
5.hieght spelling is wrong correct one is height
6. >= not this =<
Happy Coding!
+ 4
18.5 <= BMI
+ 1
The answer might be case sensitive
+ 1
I'll find a working solution in a moment.
+ 1
Thanks alot guys
0
I think That was just about <= and =< đ i didnt think that theymight be different đ
0
Thanks a lot <â
Shaurya Chauhanâ
>(Inspiration will draw you) đđđ
0
Hamed Rahimyan WELCđMEđ€