-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #304 from ayshahaneena/fourthbranch
bmi calculator
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Write a program that interprets the Body Mass Index (BMI) based on a user's weight and height. | ||
|
||
# It should tell them the interpretation of their BMI based on the BMI value. | ||
|
||
# Under 18.5 they are underweight | ||
# Equal to or over 18.5 but below 25 they have a normal weight | ||
# Equal to or over 25 but below 30 they are slightly overweight | ||
# Equal to or over 30 but below 35 they are obese | ||
# Equal to or over 35 they are clinically obese. | ||
|
||
print("BMI Calculator!\n") | ||
height = float(input("Height in m : ")) | ||
weight = float(input("Weight in kg : ")) | ||
bmi = weight / height ** 2 | ||
bmi = round(bmi,2) | ||
if bmi < 18.5 : | ||
print(f"Your BMI is {bmi} and your are underweight") | ||
elif 25 > bmi >= 18.5 : | ||
print(f"Your BMI is {bmi} and your are normalweight") | ||
elif 30 > bmi >= 25 : | ||
print(f"Your BMI is {bmi} and your are slightly overweight") | ||
elif 35 > bmi >= 30 : | ||
print(f"Your BMI is {bmi} and your are obese") | ||
else: | ||
print(f"Your BMI is {bmi} and your are clinically obese") |