Add a while loop to the BMI prcoedure below.
Add a while loop to the BMI prcoedure below.
def BMIImperial(height, weight, bmiList, Category):
BMI = (weight * 703) / (height * height)
print ("Your BMI is " + str(BMI))
if (BMI <= bmiList[0]):
print(BMI)
print('you are:', Category[0])
elif (BMI <= bmiList[1]):
print('you are:', Category[1])
elif (BMI <= bmiList[2]):
print('you are:', Category[2])
else:
print('you are:', Category[3])

The given is a snippet of Python code where a function BMIImperial takes some parameters and print out the category of body based on the passed valued.
The current implementation of the function is using if-else statement to find the category based on BMI value in the bmiList. The requirement is to implement the function uing while loop.
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 2 images









