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


Body mass index(BMI) is a measure of body fat based on height and weight that applies to adult men and women. To know your bmi, the entries required are height and weight. The formular for bmi with height in inches and weight in kilograms is bmi = weight(kg) / (height(m^2))^2. While in when weight is in pounds bmi = weight(pounds) / (height(m^2))^2 * 703. The program written below helps to calculate your Body mass index, and informs you which category you belong to.


Here's how the code works:


Initially, you enter you name, move forward to enter you weight(in pounds specifically) and add your height(in inches).

print("A Program to canlculate BMI of an individual")
name = input("Enter your name: ")
weight = float(input("Enter your weight in pounds: "))
height = float(input("Enter your height in inches: "))

Here, we encounter a function which houses some decision functions. We define our function as BMI, which will take in the arguments weight and height. I then input the formular stated earlier, bmi = weight(kg) / (height(m^2))^2. Then the program checks which of the decision statements it will return the answer to. If bmi is less than 16, it will return severely underweight. Between 16 and18 underweight, between 18.5 and 24 healthy, between 25 and 29 overweight, and above 30 is obese.

def BMI(weight, height):
    bmi = weight / (height ** 2) * 703

    if (bmi < 16):
        return 'severely underweight', bmi
    elif (bmi >= 16 and bmi < 18.5):
        return 'underweight', bmi
    elif (bmi >= 18.5 and bmi < 25):
        return 'healthy', bmi
    elif (bmi >= 25 and bmi < 30):
        return 'overweight', bmi
    elif (bmi >= 30):
        return 'obese', bmi

quote, bmi = BMI(weight, height)
print('your bmi is: {} and your are: {}'.format(bmi, quote)) 





 
 
 

Comments


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