+ 2

Help

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

15th Apr 2022, 1:04 PM
zakaria Guelmine
zakaria Guelmine - avatar
14 Answers
+ 3
#your code goes here 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')
15th Apr 2022, 5:59 PM
Ajit Kumar
Ajit Kumar - avatar
+ 2
Your code goes here 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')
18th Apr 2022, 9:32 AM
Om Maurya
Om Maurya - avatar
+ 1
weight=float(input()) height=float(input()) bmi=weight/(height**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")
17th Apr 2022, 1:14 PM
Adham
0
What have you tried so far? Please LINK your code
15th Apr 2022, 1:23 PM
Lisa
Lisa - avatar
0
BMI =int(input()) if BMI <18.5: print(Underweight) elif BMI =18.5 and BMI<25: print(Normal) elif BMI >= 30: print(Obesity)
15th Apr 2022, 1:27 PM
zakaria Guelmine
zakaria Guelmine - avatar
0
But not run
15th Apr 2022, 1:27 PM
zakaria Guelmine
zakaria Guelmine - avatar
0
You need 2 inputs, as described in the task. One of them is float. Then calculate the bmi according to the given formula. The output text needs to be string in the print(). I think you forgot the "Overweight" condition.
15th Apr 2022, 1:29 PM
Lisa
Lisa - avatar
0
Ok thanks u Lisa i will try if i find problĂšme i Will send you
15th Apr 2022, 1:34 PM
zakaria Guelmine
zakaria Guelmine - avatar
0
You don't need to send, you can link it here in the thread :) Click the little +, "Insert Code"
15th Apr 2022, 1:36 PM
Lisa
Lisa - avatar
0
Ok thanks Lisa ❀
15th Apr 2022, 1:38 PM
zakaria Guelmine
zakaria Guelmine - avatar
0
It is not helpful to a beginner if we give ready-made code without any explanation
15th Apr 2022, 6:10 PM
Lisa
Lisa - avatar
0
Thanks a lot dear
16th Apr 2022, 5:02 PM
zakaria Guelmine
zakaria Guelmine - avatar
0
weight =int(input()) height = float(input()) bmi=weight/(height *height) if bmi<18.5: print("Underweight") elif (bmi>=18.5 and bmi<25): print ("Normal") elif(bmi>=25 and bmi<38): print("Overweight ") else: print ("Obesity")
17th Apr 2022, 2:44 AM
Vudayana Sandhya Rani
0
See first you have to tell the unit in which you are taking height and weight like weight in kg and height in centimetre find this on internet like what we use unit of height with weight in kg and with weight in pound once you done it you have to take to input one of weight and one of fight take both as as float number then you can write a function for it or can right plain code and then show the output. In output show the value of BMI also like 19.5 18.5 whatever it is then write it is normal or underweight or overweight and then you can give dip like if it is underweight you can give tip of eat more and if it is overwheat you can give tip of exercise more like this.
17th Apr 2022, 6:30 AM
Nitesh Dandotiya