28-Oct-2022
.
Admin
Hi Dev,
This article will provide example of Python Program to Calculate BMI. Here you will learn Body Mass Index calculator in Python. you can see Create A BMI Calculator Using Python. This article will give you simple example of Simple Bmi Calculator Using Python With Code Examples. Let's see bellow example Calculate Your BMI.
Python BMI calculator; In this tutorial, you will learn how to implement BMI(body mass index) calculator in python.
Following examples with output:
Example 1: Python Program BMI (Body Mass Index) Calculator
# take inputs from the user
height = float(input("Enter height in meters: "))
weight = float(input("Enter weight in kg: "))
# the formula for calculating bmi
bmi = weight/(height**2)
# print result
print("Your BMI is: {0} ".format(bmi))
Output:
Enter height in meters: 1.89
Enter weight in kg: 65
Your BMI is: 18.19657904313989
I hope it can help you...
#Python