Like Us Like Us Facebook Subscribe Subscribe us YouTube Whatsapp Share us Whatsapp Query Send your queries

Tutorial to make a simple BMI Calculator using Python

Tutorial to make a simple BMI Calculator using Python

In this tutorial I am going to use Python 3.x to make a Command line application called BMI Calculator which measures BMI (Body Mass Index).

BMI :  According to Wikipedia The BMI is an attempt to quantify the amount of tissue mass (muscle, fat, and bone) in an individual, and then categorize that person as underweight, normal weight, overweight, or obese based on that value.

Formula : BMI = W / (H/100 * H/100)

Where W is weight in KG and H stands for Height in Centimeter.

Script for BMI Calculator using Python

# Python based Simple Commandline BMI Calculator
# By Sanjay Prasad
print ("Enter Height in Centimeter : ")
height = float(input(''))
print ("Enter Weight in KG : ")
weight = float(input(''))
height = height/100
bmi= weight /(height*height)
bmi=round(bmi, 1)
print ("BMI : ", bmi)

BMI Calculator using Python Screen shot

BMI Calculator using Python

BMI Calculator using Javascript  BMI Calculator using Java

5 1 vote
Article Rating
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Inline Feedbacks
View all comments