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")

9th Mar 2022, 6:41 PM
Ofere Believe
Ofere Believe - avatar
8 odpowiedzi
+ 4
Thank you i got it already
9th Mar 2022, 6:57 PM
Ofere Believe
Ofere Believe - avatar
+ 2
Look at my code: https://code.sololearn.com/c4SuxDNRnx96/?ref=app I used // operator
10th Mar 2022, 5:23 PM
aewerdev
aewerdev - avatar
0
FF9900 i just changed it and it still didnt work
9th Mar 2022, 6:53 PM
Ofere Believe
Ofere Believe - avatar
0
change last statement as: else: print("obesity")
9th Mar 2022, 7:13 PM
Hritik
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
9th Mar 2022, 7:31 PM
HungryTradie
HungryTradie - avatar
0
You have to start your string with capital letter: Underweight; Overweight; Obesity
10th Mar 2022, 7:50 PM
Ethan Sunker
Ethan Sunker - avatar
0
This should work beciase its in the instructions if i remember
10th Mar 2022, 7:51 PM
Ethan Sunker
Ethan Sunker - avatar