The following code example demonstrates how to Create a Program in Python to Compute BMI.
Basically, the following program demonstrates the use of if..elif..else ladder.
# programmingempire.com
weight = eval(input("Enter weight in Kilograms"))
height = eval(input("Enter height in meter"))
bmi = weight/(height*height)
print("BMI is", bmi)
if bmi <18.5:
print("Underweight")
elif bmi <25:
print("Normal")
elif bmi <30:
print("OverWeight")
else:
print("Obese")
Output
Further Reading
Examples of OpenCV Library in Python
A Brief Introduction of Pandas Library in Python