+ 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
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')
+ 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')
+ 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")
0
What have you tried so far? Please LINK your code
0
BMI =int(input())
if BMI <18.5:
print(Underweight)
elif BMI =18.5 and BMI<25:
print(Normal)
elif BMI >= 30:
print(Obesity)
0
But not run
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.
0
Ok thanks u Lisa i will try if i find problème i Will send you
0
You don't need to send, you can link it here in the thread :)
Click the little +, "Insert Code"
0
Ok thanks Lisa ❤️
0
It is not helpful to a beginner if we give ready-made code without any explanation
0
Thanks a lot dear
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")
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.