+ 13

BMI CALCULATOR (PYTHON BEGINNER PROJECT)

Tracking your BMI is a useful way of checking if you’re maintaining a healthy weight. It’s calculated using a person's weight and height, using this formula: weight / height² The resulting number indicates one of the following categories: Underweight = less than 18.5 Normal = more or equal to 18.5 and less than 25 Overweight = more or equal to 25 and less than 30 Obesity = 30 or more Let’s make finding out your BMI quicker and easier, by creating a program that takes a person's weight and height as input and outputs the corresponding BMI category. Sample Input 85 1.9 Sample Output Normal Here is the code I have written pls fix the error And give the solution https://code.sololearn.com/cu0ilSYmD8Df/?ref=app

4th Feb 2021, 6:14 AM
Aadeepto Debnath
Aadeepto Debnath - avatar
125 Réponses
+ 212
weight = int(input()); height = float(input()); x = weight/float(height*height); if x < 18.5: print('Underweight') if x>=18.5 and x<25: print("Normal") if x >= 25 and x < 30: print('Overweight') if x >= 30: print('Obesity')
5th Feb 2021, 3:17 PM
Motuncoded
Motuncoded - avatar
+ 27
#Here is the way #your code goes here 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") else: print("Obesity")
4th Apr 2021, 1:28 PM
Allan 🔥STORMER🔥🔥🔥🔥
Allan 🔥STORMER🔥🔥🔥🔥 - avatar
+ 12
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')
7th Feb 2021, 11:47 AM
iamzilfa
iamzilfa - avatar
+ 10
weight = float(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") elif BMI > 30: print('Obesity')
12th Sep 2021, 7:49 AM
Murtada abed
Murtada abed - avatar
+ 6
wheight=int(input()) heigt=float(input()) x=wheight/float(heigt**2) if x<18.5: print("Underwheight") if x>=18.5 and x<25: print("normal") if x>= 25 and x< 30: print("overwheight") if x>=30: print("obesity") IN AN IDE WORKS BUT IN SOLOLEARN NO WHY?
3rd Jun 2021, 8:46 PM
Alexis Torres Enriquez
Alexis Torres Enriquez - avatar
+ 6
weight = int(input()) hight = float(input()) bmi = weight / hight ** 2 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')
19th Nov 2021, 7:54 PM
Giorgi Narsia
+ 5
#your code goes here wt=int(input()) ht=float(input()) res=wt / float (ht * ht) if res < 18.5: print("Underweight") elif res>=18.5 and res<25: print("Normal") elif res>=25 and res<30: print("Overweight") else: print("Obesity") Remember that first letter of Underweight,Normal,Overweight,Obesity should be capital or else testcase fails.
5th Nov 2021, 1:44 PM
Sandhya.v
Sandhya.v - avatar
+ 4
#your code goes here weight=int(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") else: print("Obeise") what's wrong?
24th Mar 2021, 2:10 PM
Saad
Saad - avatar
+ 3
BEST CODE: weight = int(input()) height = float(input()) age = int(input()) x = weight // (height ** 2) if x < 18.5: print ("Underweight") elif x <= 24.9: print ("Normal") elif x <= 29.9: print ("Overweight") else: print ("Obesity")
15th Jun 2021, 12:49 PM
Матвей Золотухин
Матвей Золотухин - avatar
+ 2
Ok
4th Feb 2021, 7:24 AM
Aadeepto Debnath
Aadeepto Debnath - avatar
+ 2
h=52 """int(input("enter ur hieght"))""" w=1.85 """"int(input("enter ur hieght"))""" bmi=w/(h**2) if bmi>=30: print("obisty") elif bmi<=25: print("over weight") elif bmi <=18.5: print("normal") else: print("under wieght what’s wrong here ?
21st Feb 2021, 2:20 AM
Radwa Sayed Ragab
Radwa Sayed Ragab - avatar
+ 2
weight = int(input()); height = float(input()); x = weight/float(height*height); if x < 18.5: print('Underweight') if x>=18.5 and x<25: print("Normal") if x >= 25 and x < 30: print('Overweight') if x >= 30: print('Obesity')
29th May 2021, 8:24 AM
Vraj Soni
Vraj Soni - avatar
+ 2
Height=float(input('Whats your height')) Weight=float(input('Whats you weight')) BMI = Height/Weight ** 2 if BMI<18.5: print("Underweight") elif BMI>=30: print("Obesity") elif BMI>=18 and BMI<25: print("Normal") elif BMI<=25 and BMI<30: print("Overweight")
6th Apr 2023, 5:30 PM
CoderCollin
+ 1
weight = int(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") else: print("nothing")
8th Apr 2021, 4:07 PM
Sameer Deen
Sameer Deen - avatar
+ 1
w=float(input()) h=float(input()) r=w/h**2 if r<18.5: print("Underweight") elif r>=18.5 and r<25 : print("Normal") elif r>=25 and r<30: print("Overweight") elif r>=30: print("Obesity") # BMI Calculator '''Tracking your BMI is a useful way of checking if you’re maintaining a healthy weight. It’s calculated using a person's weight and height, using this formula: weight / height² The resulting number indicates one of the following categories: Underweight = less than 18.5 Normal = more or equal to 18.5 and less than 25 Overweight = more or equal to 25 and less than 30 Obesity = 30 or more '''
12th May 2021, 5:05 PM
Sanu Bose
Sanu Bose - avatar
+ 1
weight = int(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("0besity") what's wrong with my code? please check and say
16th May 2021, 12:01 PM
praveena kumar
praveena  kumar - avatar
+ 1
You have convert your all input() to float(). Because python no supported the operators int() with float(). Ok!
16th May 2021, 12:09 PM
CHUN
+ 1
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")
20th May 2021, 10:12 AM
Janhvi Tiwari
Janhvi Tiwari - avatar
+ 1
This is what I came up with and it works great! #your code goes here weight =int(input()) height =float(input()) results =(weight/(height**2)) if results < 18.5 : print("Underweight") elif results >= 18.5 and results < 25 : print("Normal") elif results >= 25 and results < 30 : print("Overweight") elif results >= 30 : print("Obesity")
21st May 2021, 12:02 PM
Gregory Dappert
Gregory Dappert - avatar
+ 1
weight =int(input()) height =float(input()) results =(weight/(height**2)) if results < 18.5 : print("Underweight") elif results >= 18.5 and results < 25 : print("Normal") elif results >= 25 and results < 30 : print("Overweight") elif results >= 30 : print("Obesity") What is wrong?
29th May 2021, 6:18 PM
bharati giri
bharati giri - avatar