Skip to content

Commit 653de9a

Browse files
BMI Calculator
1 parent de4596c commit 653de9a

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

BMICalculator.py

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
def BMI(height, weight):
2+
bmi = weight/(height**2)
3+
return bmi
4+
5+
# Driver code
6+
height = int(input('Height: '))
7+
weight = int(input('Weight: '))
8+
9+
# calling the BMI function
10+
bmi = BMI(height, weight)
11+
print("The BMI is", format(bmi), "so ", end='')
12+
13+
# Conditions to find out BMI category
14+
if (bmi < 18.5):
15+
print("underweight")
16+
17+
elif ( bmi >= 18.5 and bmi < 24.9):
18+
print("Healthy")
19+
20+
elif ( bmi >= 24.9 and bmi < 30):
21+
print("overweight")
22+
23+
elif ( bmi >=30):
24+
print("Suffering from Obesity")

0 commit comments

Comments
 (0)