top of page
learn_data_science.jpg

Data Scientist Program

 

Free Online Data Science Training for Complete Beginners.
 


No prior coding knowledge required!

Calculate Your BMI with Python


Writing a program in python is easy yet confusing. The simpler the language the complex it is sometimes to handle. But simply python is more of a language for everyone and it's sometimes easier to decode.


"

I did programming with C, C++ basically. I find python understandable but difficult to write. Thanks to the huge community of python, there's always solution available. "


For calculating BMI the first thing to notice is the input of the value. By default the input type is str, so the typecasting was required .


#check the input type
x=input()
print(type(x)) #<class 'str'> 

h = float(input("Enter an Height in (m): "))
w = float(input("Enter an Weight in kg: "))

Secondly the formula was written and lastly I had to compare the result for the condition of the health.




BMI= w/(h*h)

if BMI <= 18.4:
    print("You are underweight.")
elif BMI <= 24.9:
    print("You are healthy.")
elif BMI <= 29.9:
    print("You are over weight.")
elif BMI <= 34.9:
    print("You are severely over weight.")
elif BMI <= 39.9:
    print("You are obese.")
else:
    print("You are severely obese.")

 
 
 

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