+ 7

Hello everyone. Help build a BMI calculator . Please

15th Feb 2021, 8:38 AM
๐Ÿ‡บ๐Ÿ‡ฟ๐Ÿ‘จโ€๐Ÿ’ปOG'ABEK๐Ÿ”ฅ๐Ÿ‡บ๐Ÿ‡ฟ
๐Ÿ‡บ๐Ÿ‡ฟ๐Ÿ‘จโ€๐Ÿ’ปOG'ABEK๐Ÿ”ฅ๐Ÿ‡บ๐Ÿ‡ฟ - avatar
24 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
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
Most welcome bro๐Ÿ™๐Ÿ‘
17th Feb 2021, 9:39 AM
โค๏ธ๐Ÿ˜Prerana๐Ÿ˜โค๏ธ
โค๏ธ๐Ÿ˜Prerana๐Ÿ˜โค๏ธ - avatar
+ 1
๐Ÿฅ‡๐Ÿ†๐Ÿฅ‡๐Ÿ’ฏ๐Ÿ’ฏ๐Ÿ‘๐Ÿป๐Ÿ‘๐Ÿป
19th Aug 2021, 12:06 PM
PRO programmer
PRO programmer - avatar
+ 1
#your code goes here weight=int(input()) height=float(input()) BMI=weight/(height*height) 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")
22nd Mar 2022, 11:22 PM
Dylan Comfort
Dylan Comfort - avatar
+ 1
hello, question here is how i wrote my code: weight = int(input()) height = float(input()) x = (weight/(height**2)) if x < 18.5: print ("Underweight") elif x >= 18.5 and x < 25: print("Normal") elif x>= 25 and x < 30: print("Underweight") elif x >=30: print("Obesity") but this code did not pass the third test case. can someone explain why? i am seeing some codes wrote their BMI differently than mine as well mine:x = (weight/(height**2)) others:BMI=weight/(height*height), Bmi = Weight / (Height ** 2);, bmi = float(weight/(height**2)) can someone explain the difference?
26th Apr 2022, 3:19 PM
natalia
+ 1
weight = int(input()) height = float(input()) x = "BMI" i = weight/height**2 if i < 18.5: print("Underweight") elif i > 18.5 and i < 25: print("Normal") elif i >= 25 and i < 30: print("Overweight") else: print("Obesity")
25th Aug 2022, 8:55 AM
Hi I'm Allen
Hi I'm Allen - avatar