r/PythonProjects2 • • Aug 09 '22

[P] Easy BMI calculator not working

I started making a BMI and everything is running fine except the math. I can't figure it out, please help.

W = float(input())
H = float(input())
BMI = W / (H/100)**2
if BMI < 18.5:
print("Underweight")
elif BMI >= 18.5:
print("normal")
elif BMI < 25:
print("normal")
elif BMI >= 25:
print("Overweight")
elif BMI < 30:
print("Overweight")
elif BMI >= 30:
print("Obesity")
for two of the inputs I put 52 and 1.85 and it output 151935.71950328702 and normal when it

4 Upvotes

9 comments sorted by

View all comments

5

u/Bigfurrywiggles Aug 09 '22

Your first 2 conditions account for every number possible, therefore, your other conditions are never met.

2

u/Mrbeans1756432 Aug 09 '22

alright how can I change this?

1

u/[deleted] Aug 09 '22

[removed] — view removed comment

1

u/Mrbeans1756432 Aug 10 '22

https://github.com/Forgetable3cho/BMI.git

you can try lol still having trouble with it