Skip to main content

Python program for calculating BMI (Advanced)

This is an advanced code for BMI calculator for one who are beginners in python. 
You can calculate the following data from this code... 
1. Your Body Mass Index (BMI) 
2.Your fitness condition based on your weight. 
3.The amount of weight you need to gain or loss.. 
#program goes like this

w=int(input('Enter your weight in kgs..'))
h=float(input('Enter your height in m..'))

def bmi(w,h):
    bmi=w/(h**2)
    print('Your BMI is ',bmi)

    if bmi>18 and bmi <25:
        print('You are healthy')

    elif bmi<18:
        print('You are underweight')
        for x in range(0,100,1):
            if (w+x)/h**2>18:
                a=x
                int (a)
                break
    print('You need ',a,' kg more weight to be healthy')

    else:
        print('You are overweight')
        for x in range(0,100):
            if (w-x)/h**2<=25:
            a=x
           break
    print('You need to reduce ',a,' kg more weight to be healthy')

bmi(w,h)

Comments

Popular posts from this blog

Pithoragarh Fort

United States of America (Discovery and Facts)

United States (Discovery and Facts) Preview – (click to reach directly on below options) 1.   Amazing America (Basic Introduction) 2.   History in Brief 3.   Long Story of USA 4.   Etymology (Naming America)             5.   Geography Amazing America United States, also known as United States of America (USA). USA is the most developed country located in North America; it is a federal republic of 50 states. Besides the states in the main territory USA also includes the state of Alaska, and the island of Hawaii. The states of USA are bounded by Canada in north, by Pacific Ocean in west, and by the   Gulf of Mexico and   Mexico in south. The United States is the fourth largest country in the world in terms of area (after   Russia, Canada, and   China) and is slightly smaller than the entire continent of Europe. The national capital of USA is Washington.  USA...

Excretion IN Humans and Animals

Excretion In Humans Excretion is one of the essential life processes which is required for a living organism to survive.      Excretion is defined as the process of removal of toxic waste materials from one's body.In humans,the nitrogenous waste products,i.e, urea ,is excreted through a well established system called urinary system or excretory system. Human Excretory System consists of a pair of Kidneys and ureters,a Urinary bladder ,and Urethra.Waste is filtered from the blood and is collected in the form of urine in each Kidney. Urine leaves the kidneys through the ureters and is temporarily stored in the Urinary Bladder. From here the urine leaves the body through urethra. Components of Urinary System and their Functions The human Urinary system has following main components- Kidneys Nephrons and Nephric tubules Collecting Tubules Ureters Urinary Bladder Urethra [If you want to read about MECHANISM of urine formation then cl...