Skip to content

Commit 66e7a10

Browse files
committed
Added excercise_7.py to Python-Basic-to-Advance repo
1 parent 1e1e250 commit 66e7a10

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

excercise_7.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# BMI Calculator
2+
weight = float(input("Enter your weight in kg: "))
3+
height = float(input("Enter your height in meters: "))
4+
5+
bmi = weight / (height ** 2)
6+
print("BMI:", round(bmi, 2))
7+
8+
if bmi < 18.5:
9+
print(f"Your BMI is {round(bmi,2)} and you are underweight.")
10+
elif bmi < 25:
11+
print(f"Your BMI is {round(bmi,2)} and you have a normal weight.")
12+
elif bmi < 30:
13+
print(f"Your BMI is {round(bmi,2)} and you are overweight.")
14+
elif bmi < 35:
15+
print(f"Your BMI is {round(bmi,2)} and you are obese.")
16+
else:
17+
print(f"Your BMI is {round(bmi,2)} and you are clinically obese.")

0 commit comments

Comments
 (0)