Skip to content

Commit

Permalink
Merge pull request #304 from ayshahaneena/fourthbranch
Browse files Browse the repository at this point in the history
bmi calculator
  • Loading branch information
sudhanshu-77 authored Oct 27, 2024
2 parents a895205 + cb0112b commit a205b32
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions BMI_calculator 2.0.py
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")

0 comments on commit a205b32

Please sign in to comment.