Hello everyone. Help build a BMI calculator . Please | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 7

Hello everyone. Help build a BMI calculator . Please

15th Feb 2021, 8:38 AM
🇺🇿👨‍💻OG'ABEK🔥🇺🇿
🇺🇿👨‍💻OG'ABEK🔥🇺🇿 - avatar
27 Answers
+ 5
weight=int(input()) height=float(input()) BMI=weight/(height/100)**2 if bmi<18.5: print("Underweight") elif bmi>=18.5 and bmi<25: print("Normal") elif bmi>=25 and bmi<30: print("Overwight") else: print("Obesity")
26th Sep 2022, 11:31 PM
Modester Muchekecha
Modester Muchekecha - avatar
+ 12
Post your attempt first
15th Feb 2021, 8:41 AM
Slick
Slick - avatar
+ 9
Thanks 🔥🔥👍👍😊😊
16th Feb 2021, 1:27 PM
🇺🇿👨‍💻OG'ABEK🔥🇺🇿
🇺🇿👨‍💻OG'ABEK🔥🇺🇿 - avatar
+ 9
#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') This will works
17th Feb 2021, 3:06 AM
❤️😍Prerana😍❤️
❤️😍Prerana😍❤️ - avatar
+ 7
Height=float(input()) Weight=float(input()) x= "BMI" x = Height/Weight ** 2 if x<18.5: print("Underweight") elif x>=30: print("Obesity") elif x>=18 and x<25: print("Normal") elif x>=25 and x<30: print("Overweight")
16th Feb 2021, 1:24 PM
Luxmi
Luxmi - avatar
+ 6
Thank you all 😊😊😊
15th Feb 2021, 11:19 AM
🇺🇿👨‍💻OG'ABEK🔥🇺🇿
🇺🇿👨‍💻OG'ABEK🔥🇺🇿 - avatar
+ 5
Your attempt? Please post it here?
15th Feb 2021, 8:47 AM
∆BH∆Y
∆BH∆Y - avatar
+ 5
Thank you bro😊😊👍🔥
15th Feb 2021, 1:26 PM
🇺🇿👨‍💻OG'ABEK🔥🇺🇿
🇺🇿👨‍💻OG'ABEK🔥🇺🇿 - avatar
+ 4
Thank you sister 😊😊😊
17th Feb 2021, 4:34 AM
🇺🇿👨‍💻OG'ABEK🔥🇺🇿
🇺🇿👨‍💻OG'ABEK🔥🇺🇿 - avatar
+ 3
Use the formula : BMI = (weight in kg) / (square of the height in m)
15th Feb 2021, 10:31 AM
Sonic
Sonic - avatar
+ 3
∆BH∆Y you can't write "height in m**2" because the units of height are metres and not square metres.
15th Feb 2021, 7:19 PM
Sonic
Sonic - avatar
+ 3
∆BH∆Y by writing (height in m)**2 we signify that we're squaring the value of height expressed in units of metres. If you write (height in m**2) you're saying that the units of height are square metres, which is wrong.
15th Feb 2021, 7:23 PM
Sonic
Sonic - avatar
+ 3
# your code starts here ... Weight = int(input()); Height = float(input()); Bmi = Weight / (Height ** 2); if Bmi < 18.5: print("Underweight") elif 18.5 <= Bmi < 25: print("Normal") elif 25 <= Bmi < 30: print("Overweight") else: if Bmi >= 30: print("Obesity") #No biggie!All programs create bugs.Go back and squash them .
30th Jan 2022, 4:23 PM
Vadakapuram. Kavya.
Vadakapuram. Kavya. - avatar
+ 2
∆BH∆Y by "(height in m) **2", what I meant was the square value of the height in metres. I have rephrased my answer if it confused you.
15th Feb 2021, 7:17 PM
Sonic
Sonic - avatar
+ 2
∆BH∆Y no problem 👍
16th Feb 2021, 6:17 AM
Sonic
Sonic - avatar
+ 2
weight = int(input()); height = float(input()); bmi = float(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') else: print('Obesity')
15th Jul 2021, 12:42 PM
Eren Der Teufel
Eren Der Teufel - avatar
+ 1
Sonic , your answer confused me I have a question How, BMI = (weight in kg) / (height in m) ** 2 Is the same as BMI = (weight in kg) / (height in m**2)
15th Feb 2021, 1:14 PM
∆BH∆Y
∆BH∆Y - avatar
+ 1
Sonic sir, thank you very much 😃 Now I understood
16th Feb 2021, 1:50 AM
∆BH∆Y
∆BH∆Y - avatar
+ 1
Most welcome bro🙏👍
17th Feb 2021, 9:39 AM
❤️😍Prerana😍❤️
❤️😍Prerana😍❤️ - avatar
+ 1
🥇🏆🥇💯💯👍🏻👍🏻
19th Aug 2021, 12:06 PM
PRO programmer
PRO programmer - avatar