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")

2nd Sep 2021, 10:17 AM
Hamed Rahimyan
8 odpowiedzi
+ 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!
2nd Sep 2021, 10:30 AM
<★Shaurya Chauhan★>
<★Shaurya Chauhan★> - avatar
+ 4
18.5 <= BMI
2nd Sep 2021, 10:22 AM
Simba
Simba - avatar
+ 1
The answer might be case sensitive
2nd Sep 2021, 10:23 AM
Hack
Hack - avatar
+ 1
I'll find a working solution in a moment.
2nd Sep 2021, 10:24 AM
Hack
Hack - avatar
+ 1
Thanks alot guys
2nd Sep 2021, 10:28 AM
Hamed Rahimyan
0
I think That was just about <= and =< 😑 i didnt think that theymight be different 😑
2nd Sep 2021, 10:27 AM
Hamed Rahimyan
2nd Sep 2021, 10:36 AM
Hamed Rahimyan
0
Hamed Rahimyan WELC🙂ME🤝
2nd Sep 2021, 10:42 AM
<★Shaurya Chauhan★>
<★Shaurya Chauhan★> - avatar