+ 1

Who can I solve test of BMI ?

It is an program to find Body Mass Index I made it but only one case is right at time and other one is showing wrong

9th Apr 2021, 7:58 AM
Monu Yadav
Monu Yadav - avatar
13 Antworten
0
Monu Yadav you don't need to know the test cases if you follow the instructions, so they are hidden for a reason. Pro users also can't see them
9th Apr 2021, 8:55 AM
Benjamin Jürgens
Benjamin Jürgens - avatar
+ 1
they are hidden, as there are difficulties in checking all possible combinations, so the tests are selective and some are hidden, so that there is no manipulation of the results.
9th Apr 2021, 8:58 AM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
0
Hi! Can you show code attempt?
9th Apr 2021, 8:01 AM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
0
first of all, you should not directly specify the height and weight values. your program should prompt you to enter these values manually
9th Apr 2021, 8:16 AM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
0
And you forgot Overweight. Also remove the spaces from output strings
9th Apr 2021, 8:20 AM
Benjamin Jürgens
Benjamin Jürgens - avatar
0
And you forgot Overweight. Also remove the spaces from output strings as Benjamin said
9th Apr 2021, 8:52 AM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
- 1
Wait let me show you
9th Apr 2021, 8:11 AM
Monu Yadav
Monu Yadav - avatar
- 1
weight = 1 height = 1.7 BMI=weight/height**2 if BMI < 18.5: print ("Underweight ") if BMI >= 18.5 and BMI < 25: print (" Normal ") if BMI >= 30: print (" Obesity ")
9th Apr 2021, 8:12 AM
Monu Yadav
Monu Yadav - avatar
- 1
How can it made 2 cases right at same time
9th Apr 2021, 8:13 AM
Monu Yadav
Monu Yadav - avatar
- 1
weight = int(input()) height = float(input()) The test cases give the numbers for each test case via input
9th Apr 2021, 8:17 AM
Benjamin Jürgens
Benjamin Jürgens - avatar
- 1
Have you paid subscription
9th Apr 2021, 8:47 AM
Monu Yadav
Monu Yadav - avatar
- 1
Can you tell me third question of BMI it is locked in my course and it shows an error I don't know for what
9th Apr 2021, 8:48 AM
Monu Yadav
Monu Yadav - avatar
- 1
make sure that you used the right operators like >= (greater or equal to) etc make sure you use the right division type also make sure you remember to square the height
9th Apr 2021, 9:45 PM
Rammy Aly