0
Python for beginners
[solved] Please can someone tell me what is wrong with this code ? Thank you please weight = float(input()) height = float(input()) bmi = weight/(height**2) if bmi < 18.5: print("underweight") elif bmi >= 18.5 and bmi < 25: print("Normal") elif bmi >= 25 and bmi < 30: print("overweight") elif bmi > 30: print("obesity")
8 Réponses
+ 4
Thank you i got it already
+ 2
Look at my code:
https://code.sololearn.com/c4SuxDNRnx96/?ref=app
I used // operator
0
FF9900 i just changed it and it still didnt work
0
change last statement as:
else:
print("obesity")
0
G'day Berve01 congratulations on getting the Python BMI challenge done. Did you have to adjust your outputs to have correct capitalisation?
Would you do a bit of housekeeping, edit your original post to start with [Solved]?
Have you found the Q&A search bar (it is the magnifying glass icon at the top of the discuss screen)? Did you know you can link other Q&A posts or SoloLearn code bits (use the plus icon)?
https://www.sololearn.com/discuss/1316935/?ref=app
0
You have to start your string with capital letter: Underweight; Overweight; Obesity
0
This should work beciase its in the instructions if i remember