Python Program to Calculate BMI
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
- Get Last 2 Digits of Number in Python Tutorial Example
- How to Sum of First and Last Digit of Number in Python?
- How to Get First and Last Digit of Number in Python?
- Get the Last Digit of Number in Python Tutorial Example
- Get the First Digit of Number in Python Tutorial Example
- How to Remove All Decimals from Number in Python?
- How to Convert String to Float with 2 Decimal Places in Python?
- How to Format Number to 2 Decimal Places in Python?