Nishant Kumar
Cosmic Techie

Cosmic Techie

BMI (Body Mass Index) Calculator

Nishant Kumar's photo
Nishant Kumar
·Jan 15, 2022·

1 min read

BMI (Body Mass Index) Calculator

Subscribe to my newsletter and never miss my upcoming articles

Body mass index (BMI) is a measure of body fat based on height and weight. The formula is BMI = kg/m2 where kg is a person’s weight in kilograms and m2 is their height in metres squared.

Height=float(input("Enter your height in centimeters: "))
Weight=float(input("Enter your Weight in Kg: "))
Height = Height/100
BMI=Weight/(Height*Height)
print("Your Body Mass Index is: ",BMI)

if(BMI<=18.5):
    print("Oops! You are underweight.")
elif(BMI<=24.9):
    print("Awesome! You are healthy.")
elif(BMI<=29.9):
    print("You are overweight.")
else:
    print("You are Obese. Start Exercise.")
 
Share this