0
I want help for creating a BMI calculator in python beginners course.
The resulting number indicates one of the following categories: Underweight = less than 18.5 Normal = more or equal to 18.5 and less than 25 Overweight = more or equal to 25 and less than 30 Obesity = 30 or more https://code.sololearn.com/c0A9enu6t33O/?ref=app
13 Respostas
+ 1
I hope this helps!!
https://code.sololearn.com/cGCQqtju4CNm/?ref=app
+ 7
w=int(input())
h=float(input ())
bmi=(w/(h**2))
if bmi<18.5:
print("Underweight")
elif bmi>18.5:
print ("Normal")
elif bmi>25.0:
print ("Overweight")
elif bmi>30.0:
print ("Obesity")
i think its better❤
+ 6
You can use if instead of while ,its better
And in line 11 you use while after break
that while can not work
+ 4
No it's not right way
While is a loop in python which has a no meaning here and yes indention effects a lot in python so keep that also in mind.
You need to use if elif else logic with logical operators ie and
+ 2
I AM S.P. Thank You So Much It works .... 🥰🥰
+ 1
PokéBoi Yveltal if it worked than please mark my answer as correct. (Best answer) 😀😀
+ 1
I AM S.P. done
0
amir it's not working sad
0
It's possible to solve it in three lines:
https://code.sololearn.com/cu8NzXNr7Pk4/?ref=app
0
Raffaele Bisogno You're right but sololearn code coach problems doesn't accepts more output than the expected output... it will be considered wrong but your code is absolutely correct.
0
I AM S.P. , you can remove the text if you want.
0
Raffaele Bisogno it's not the matter of the text, actually he's new to coding hence it's better for him to solve in simple way, you are pro hence you may understand and wrote it... just for his convenience!!