Basic Programs

If Else Programs

While loop Programs

For loop Programs

List Programs

Dict Programs


Python Program to Calculate Body Mass Index(BMI)


Write a python program to input weight(W) and height(H) from the user and calculate Body Mass Index(BMI).

BMI formula is,

bmi = kg/m2

Where,

  • kg - weight in kiligrams
  • m - height in meters
example.py
w=float(input("Enter Your Weight (in kg) : "))
h=float(input("Enter Your Heihgt (im meters) : "))
bmi=w/h**2
print("BMI is : ",bmi)

Output

Enter Your Weight (in kg) : 65
Enter Your Heihgt (im meters) : 1.75
BMI is :  21.224489795918366

Prev Next