+ 1
BMI calculator code project
-------------------------------------------------- For BMI calculator code project: -------------------------------------------------- weight=float(input()) height=float(input()) BMI=weight/height**2 if BMI<18.5: print("Underweight") if BMI>=18.5 and BMI<25: print("Normal") if BMI>=25 and BMI<30: print("Overweight") if BMI>=30: print("Obesity") ----------------------------------------------- Do not use the else statement! ----------------------------------------------- https://code.sololearn.com/cWKLRSwUymM5/?ref=app
9 Respostas
+ 2
Do you have a question?
It seems to work fine.
https://www.sololearn.com/discuss/1316935/?ref=app
https://www.sololearn.com/discuss/3021159/?ref=app
+ 1
My implementatiom without else statememt:
bmi=int(input())/float(input())**2
result={30: 'Obesity', 25: 'Overweight', 18.5: 'Normal', 0: 'Underweight'}
for i in result.keys():
if bmi>i:
print(result[i])
break
+ 1
Thank you Mateusz
+ 1
weight=float(input())
height=float(input())
BMI=weight/height**2
if 0<=BMI and BMI<18.5:
print("Underweight")
elif BMI>=18.5 and BMI<25:
print("Normal")
elif BMI>=25 and BMI<30 :
print ("Overweight")
else:
print("Obesity")
+ 1
Basudab De Only illuminatis know...
+ 1
Mateusz 😂😂
0
You probably want to post it in code section. Go to "Create" -> "Code". If you manage to do it and stop spamming I'll even upvote your code.
0
How to make a triangle