mehrzad1818 / Teach_me_python

This repo contains pieces of code learnt from an online video course. It has both the original codes the instructor writes and modified versions by me.
4 stars 0 forks source link

BMI Calculator #3

Closed mehrzad1818 closed 1 year ago

mehrzad1818 commented 1 year ago
height = float(input("Enter your height in m: "))
weight = float(input("Enter your weight in kg: "))

bmi = ((weight)/(height ** 2))
print(int(bmi))

if bmi >= 30:
    print("Obese: Consult your physician immediately.")
elif 25 <= bmi < 30:
    print("Overwight: Consider going on a diet under supervision.")
elif 18.5 <= bmi < 25:
    print("Normal weight: Your body is in shape.")
else:
    print("Underwight: Consider visiting a nutrientist.")
mehrzad1818 commented 1 year ago
print("Welcome to BMI Calculator.\n")
height = float(input("Enter your height in m: "))
weight = float(input("Enter your weight in kg: "))

bmi = round(((weight // (height ** 2))))

if bmi < 18.5:
    print(f"Your BMI is {bmi}. You are underweight.")
elif bmi < 25:
    print(f"Your BMI is {bmi}. You have a normal weight.")
elif bmi < 30:
    print(f"Your BMI is {bmi}. You are overweight.")
elif bmi < 35:
    print(f"Your BMI is {bmi}. You are obese.")
else:
    print(f"Your BMI is {bmi}. You are clinically obese.")