BMI CALCULATOR

D

Deleted member 8365

ALLAH IS BLACK 😎
Joined
Jul 12, 2020
Posts
29,540
Reputation
25,808
That BMI calculator… had the concept down but kept failing one of the hidden tests and didnt know why. Had the general code right all along, but I was too exclusive w my elif conditions and only gave 1 decimal place. For instance, I shortsightedly used <=24.9 to output an Normal score rather than using <25. Its obvious now, but i spent an hour rewriting the whole thing so very many times. Thats an hour invested into never making that mistake again.

w = float(input())
h = float(input())
bmi = (w / (h**2))

if bmi < 18.5:
print("Underweight")
elif bmi < 25:
print("Normal")
elif bmi < 30:
print("Overweight")
else:
print("Obesity")
 

Similar threads

cookiekingglazer
Replies
27
Views
140
emogymmaxx
emogymmaxx
BruhyanLM
Replies
10
Views
82
GandysOrbitals
GandysOrbitals
Jeffrey_Dragon
Replies
1
Views
27
chud10282892
chud10282892
f219
Replies
3
Views
74
f219
f219
L(oser)ooksmaxxer
Replies
3
Views
101
fedecope
fedecope

Users who are viewing this thread

Back
Top
Sponsored
Stake.us
America's #1 Social Casino
Slots, Poker & More
Join Now →