Python ProgrammingPython Programming

Calculate Body Mass Index (BMI) of an individual

Develop a program that computes the body mass index (BMI) of an individual. Program should begin by reading a height and weight from the user. If you read the height in centimeters then need to convert it in meters and the weight in kilograms.
##
#Python's program to calculate the body mass index (BMI) of an individual
##

#Define the constants
METER	= 100

#Read the inputs from user
height	= float(input("Enter your height in Centimeters: "))
weight	= float(input("Enter your weight in Kg: "))

temp 	= height / METER
#Calculate the BMI
bmi = weight / (temp*temp)

#Display the result
print("Your Body Mass Index is: ","%d"%(bmi))
Sample output of above program.
C:\Python\programs>python program.py
Enter your height in Centimeters: 105
Enter your weight in Kg: 69
Your Body Mass Index is: 62

C:\Python\programs>