0

Someone please help me in this python problem

Problem--- 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. My answer--answer-- 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") else: print("Obesity") Please tell me what's wrong in it

21st Dec 2021, 4:02 AM
Rishabh Bhakar
15 Answers
+ 2
Indent and explain why Python needs indentation.
21st Dec 2021, 4:32 AM
Solo
Solo - avatar
+ 2
Indentation is wrong
21st Dec 2021, 5:27 AM
Sanjyot21
Sanjyot21 - avatar
+ 1
rishabh Use proper indentation and try again that's all.
21st Dec 2021, 6:07 PM
Sanjyot21
Sanjyot21 - avatar
+ 1
How do I know someone’s capability just by looking at the question, Stesha Quarcoo ?😅
23rd Dec 2021, 12:48 AM
Amber Singh Rathour Pandey
Amber Singh Rathour Pandey - avatar
0
Tested and seems fine Check if is failing the first letter not in uppercase like underweight and overweight Or the code indentation
21st Dec 2021, 4:19 AM
Thiago Stropp
Thiago Stropp - avatar
0
As Thiago Stropp has stated, your issues are : Indentation Outputs don't match requirements
21st Dec 2021, 4:29 AM
Rik Wittkopp
Rik Wittkopp - avatar
0
You should try creating a function for BMI which takes two inputs, weight and height, then inside of the function, create if statements then call the function. Don’t forget to use correct indentation. Good luck.
22nd Dec 2021, 6:20 PM
Amber Singh Rathour Pandey
Amber Singh Rathour Pandey - avatar
0
Ok now what you want
23rd Dec 2021, 2:11 PM
SANTHOSH V
SANTHOSH V - avatar
0
weight = float(input()) height = float(input()) person_weight = weight / height**2 if person_weight <18.5: print("Underweight") elif person_weight>=18.5 and person_weight<25: print("Normal") elif person_weight>=25 and person_weight<30: print("Overweight") elif person_weight>=30: print("Obesity")
3rd Oct 2022, 9:23 AM
shamim alam
- 1
Try this: w=int(input()) h=float(input()) bmi=w//(h**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')
22nd Dec 2021, 4:29 PM
Stesha Quarcoo
Stesha Quarcoo - avatar
- 1
Amber Singh Rathour Pandey Don't forget this is a practice activity and the student hasn't yet reached learning functions on Python
22nd Dec 2021, 7:31 PM
Stesha Quarcoo
Stesha Quarcoo - avatar
- 1
Check it out a lil logic in it . I invert number sequence so I don't have to put and operator for defining range weight = float(input()) height = float(input()) hg = height * height result = weight / hg if result < 18.5 : print ("Underweight") elif result > 30 : print ("Obesity") elif result > 25 : print ("Overweight") else : print ("Normal")#check properly the program please
23rd Dec 2021, 2:58 AM
SANTHOSH V
SANTHOSH V - avatar
- 1
Amber Singh Rathour Pandey Well, we did learn this during the Python lesson before learning functions,remember?😉
23rd Dec 2021, 11:18 AM
Stesha Quarcoo
Stesha Quarcoo - avatar
- 2
So what should I do next
21st Dec 2021, 5:48 AM
Rishabh Bhakar
- 3
Your indentation was worry please check it .while using condition method colon should been used Try this: w=int(input()) h=float(input()) BMI=w/(h**2) if BGM<18.5: print('Underweight') elif BGM>=18.5 and BGM<25: print('Normal') elif BGM>=25 and BGM<30: print('Overweight') else: print('Obesity')
22nd Dec 2021, 11:38 PM
SANTHOSH V
SANTHOSH V - avatar