+ 1

I can't find the solution. Please 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

10th Aug 2022, 8:45 AM
Kostas
Kostas - avatar
5 Answers
+ 3
Your try? what's your difficulty?
10th Aug 2022, 8:49 AM
Jayakrishna 🇼🇳
+ 2
I wrote it super!!! super!!!super!!!
11th Aug 2022, 6:42 AM
Kostas
Kostas - avatar
+ 1
Djeddi Mohamed Islem your sample code can be simplified further by removing redundant logic. Consider, if bmi<18.5 is false, then logically it is true that bmi>=18.5 so there is no need to test whether it is true. You only need to test the next threshold, elif bmi<25: The same reduction can be done for each threshold. elif bmi<30: Also, note that Python is case-sensitive. Your cell phone keyboard inserted undesired capitalization that would need correction to make the code run.
11th Aug 2022, 5:32 AM
Brian
Brian - avatar
+ 1
Thanks for the notes
11th Aug 2022, 6:11 AM
Kostas
Kostas - avatar
0
Weight = int(input)) Height = int(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") #that's the simpliest way possible to solve this
10th Aug 2022, 1:33 PM
Djeddi Mohamed Islem
Djeddi Mohamed Islem - avatar