+ 1

Someone help meh to solve this question 😑

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.

27th Jan 2022, 7:21 PM
Abdul Wahab
14 Antworten
0
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")
29th Jan 2022, 3:02 PM
Om Sachin Wagh
Om Sachin Wagh - avatar
0
Hello :3 Where's your try??
28th Jan 2022, 3:16 AM
NEZ
NEZ - avatar
0
ㅤㅤㅤ maybe he could be a beginner who is struggling to wrtie code to an basic question . Yeah I might have shared him the solution instead of encouraging him to try the question on his own. But what i taught was he could refer to my solution and actually learn from it. We can’t always follow the norms you know.
28th Jan 2022, 6:52 AM
hamishhr
hamishhr - avatar
0
hamishhr Giving someone direct solutions is not right as they will not learn anything but just ask for it again and again, so do you think it's good?That the asker won't learn anything, won't practice anything and just ask for the solutions? edit]: if he/she is struggling then he/she should attach the code here not ask for direct solutions
28th Jan 2022, 7:28 AM
NEZ
NEZ - avatar
0
Hello :3 but also try to learn amd solve the problems.
28th Jan 2022, 7:31 AM
hamishhr
hamishhr - avatar
0
ㅤㅤㅤ i don’t know how to call you . But lemme just name you as invisble unicode character user. Yeah you are correct . But i hope he will learn to solve the question on his own.
28th Jan 2022, 7:32 AM
hamishhr
hamishhr - avatar
0
hamishhr we need to use continue operation instead of elif
28th Jan 2022, 6:51 PM
Abdul Wahab
0
ㅤㅤㅤ I,try many time but didn't succeed but I forgor to save my code😂
28th Jan 2022, 6:53 PM
Abdul Wahab
0
Yulia not worked
30th Jan 2022, 9:14 AM
Abdul Wahab
0
Om Sachin Wagh woah u got it man☺️ thanks
30th Jan 2022, 9:15 AM
Abdul Wahab
0
You are welcome.
30th Jan 2022, 11:03 AM
Om Sachin Wagh
Om Sachin Wagh - avatar
0
My code is correct, maybe the problem is that I output additional data, if this is sololearn task then an error could occur.
30th Jan 2022, 11:32 AM
Yulia
- 1
weigth = float(input("Enter weight: ")) height = float(input("\nEnter height(m): \n")) bmi = weigth/(height ** 2) a = round(bmi, 2) print(a) 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")
29th Jan 2022, 6:22 PM
Yulia
- 3
height = float(input("Enter your height in cm: ")) weight = float(input("Enter your weight in kg: ")) BMI = weight / (height/100)**2 if BMI <= 18.5: print("Underweight.") elif BMI <= 18.5 and BMI < 25: print("You are healthy.") elif BMI >= 25 and BMI <30: print("Overweight") else: print("Obesity")
27th Jan 2022, 7:24 PM
hamishhr
hamishhr - avatar