0
Guys why doesn't this BMI calculator program work?
Coding feels exciting for the first time haha. Butt im stuck there.. The app shows error everytime I try to calculate this. Can anyone help me out? It would mean alot. https://code.sololearn.com/csohBYR7y0sx/?ref=app
5 Respostas
+ 2
Ne Obliviscaris2
Try this:
#your code goes here
weight = int(input());
height = float(input());
bmi = weight/float(height*height);
if 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')
0
Check this solution:
https://code.sololearn.com/c4LHaM4dB0qZ/?ref=app
0
Maybe try to delete that text from your input commands
0
I don't think I should change anything in the input because it's just displaying text and nothing more. I do not see that much of a difference in our respective codes. Except that I've used else and you've gone with elif. Else does seem vague whereas elif seems more specific here.
0
Tomáš Konečný thanks for your time, mate!