- 3
BMS CALCULATOR IS WRONG.
x=float(input("Enter Your Weight")) y=float(input("Enter Your Height")) z=(x/(y**2)) if z<18.5: print("undernoursihed") elif 18.5<=z<25: print("Normal") elif 25<=z<30: print("Overwieght") else: print("obesity") THIS CODE SHOWING WRONG OUTPUT
10 odpowiedzi
+ 3
Silent Pearls , you also wrote wrong "Overweight". Change it. Also when you check for multiple conditions in if and elif clauses use "and" to join them.
+ 2
"undernoursihed" (what kind of typo is it?) => "Underweight", "Overwieght" => "Overweight", "obesity" => "Obesity".
Also, it is BMI, not BMS.
+ 1
in python, too, such a record of comparing values is acceptable
+ 1
Yes, but if the record is much longer, it makes it hard to read and debug. I think it's more clear to do it with "and" logical operator.
+ 1
Agree, but on the other hand it is easy to get confused between "and" and "or"
+ 1
It all depends on your knowledge. You can make easy mistakes, because your lack of knowledge. Other thing to mention is that many programming languages such as: Java, C#, PHP etc. don't accept such a record without logical operators between the conditions.
0
Hi! Type all answers in first uppercase letter, delete string message from input
0
your goal is to pass five tests in the task?
- 2
I think no
- 4
Send me the answer of 28 CODE PROJECT OF PYTHON FOR BEGINNERS COURSE ON SOLOLEARN..