top of page
learn_data_science.jpg

Data Scientist Program

 

Free Online Data Science Training for Complete Beginners.
 


No prior coding knowledge required!

BMI Calculator with Python

Writer's picture: Vanessa ArhinVanessa Arhin


Body Mass Index (BMI) is a way to determine if your weight is healthy for your height. One's BMI value can the person or help health care providers lessen health risks arising due to his/her weight. BMI is the measurement used to determine body fat of a person.


Body Mass Index is calculated by dividing a person's body mass by the square of the body height. It has the units kg/m^2.


This article includes a python code calculate BMI.


The first part of the code requires the user to enter his/her weight in kilograms(kg) and height in metres(m).


weight = float(input('Enter your weight(in kilograms): '))

height = float(input('Enter your height(in metres): '))


After the values are been entered, it calculates the BMI value using the values the user provided and displays the BMI value.


bmi = weight / (height ** 2)

print('Your body mass index is ', bmi, 'kg/m^2')



The program also tells the you about which weight classification your BMI value fall under, using the standard BMI classification chart.


if bmi < 18.5 :

print('This is considered underweight')

elif 18.5 <= bmi < 25:

print('This considered healthy')

elif 25 <= bmi < 30:

print('This is considered overweight')

else:

print('This is considered obese')


Using this program one can get to know their BMI value.













1 comment

Recent Posts

See All

1 Comment


Data Insight
Data Insight
Sep 18, 2021

You should highlight everywhere you have code and click the code snippet button. See your other article for example where this was done for you. https://www.datainsightonline.com/post/age-calculator

Like

COURSES, PROGRAMS & CERTIFICATIONS

 

Advanced Business Analytics Specialization

Applied Data Science with Python (University of Michigan)

Data Analyst Professional Certificate (IBM)

Data Science Professional Certificate (IBM)

Data Science Specialization (John Hopkins University)

Data Science with Python Certification Training 

Data Scientist Career Path

Data Scientist Nano Degree Program

Data Scientist Program

Deep Learning Specialization

Machine Learning Course (Andrew Ng @ Stanford)

Machine Learning, Data Science and Deep Learning

Machine Learning Specialization (University of Washington)

Master Python for Data Science

Mathematics for Machine Learning (Imperial College London)

Programming with Python

Python for Everybody Specialization (University of Michigan)

Python Machine Learning Certification Training

Reinforcement Learning Specialization (University of Alberta)

Join our mailing list

Data Insight participates in affiliate programs and may sometimes get a commission through purchases made through our links without any additional cost to our visitors.

bottom of page