Articles

Python program to calculate body mass index

Python program to calculate body mass index


In this python programming article, we are going to learn

  • python program to calculate body mass index

Python program to calculate bmi

The python program to calculate body mass index is as follows:

 

# Owner : TutorialsInhand Author : Devjeet Roy

weight = float(input("Enter your weight(lbs): "))
height = float(input("Enter your height(in): "))

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

print("The BMI of the person is",round(bmi,2))

The output of the python program to calculate bmi is as follows:

 

PS C:\Users\DEVJEET\Desktop\tutorialsInHand> python code.py                         
Enter your weight(lbs): 190
Enter your height(in): 72
The BMI of the person is 25.77

Few important tips about the program

1. Firstly we take the user's weight in lbs and height in inches. Thereafter we calculate the BMI.

2. The formula is BMI = (703 x weight) / height

 

Python program to calculate body mass index snapshot:

python program to calculate body mass index

This completes our task to calculate bmi in python.


Basic Python Programs

Would you like to see your article here on tutorialsinhand. Join Write4Us program by tutorialsinhand.com

About the Author
Devjeet Roy
Full Stack Web Developer & Data Science Enthusiast
Page Views :    Published Date : Aug 26,2021  
Please Share this page

Related Articles

Like every other website we use cookies. By using our site you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our Terms of Service. Learn more Got it!