In [ ]:
#!/usr/bin/python

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

def describe(bmiCalc):
    if bmiCalc < 18.5:
        return "You are underweight."
    elif 18.5 <= bmiCalc < 25:
        return "You are normal weight."
    elif 25 <= bmiCalc < 30:
        return "You are overweight."
    else:
        return "You are obese."

def improvement(bmiCalc):
    if bmiCalc < 18.5:
        return "Try to gain more weight by eating healthy and working out!"
    elif 18.5 <= bmiCalc < 25:
        return "Try to stay healthy and keep up taking care of your body!"
    elif 25 <= bmiCalc < 30:
        return "You should learn how to balance your diet and eat less. Make sure you monitor what you are eating in order to stay healthy! Take care of your body too."
    else:
        return "You should go see a healthcare professional and doctor in order to balance your health."

def health_concerns(bmiCalc):
    if bmiCalc < 18.5:
        return "You must gain more weight. You are putting your body at risk to diseases, vitiman deficiencies, slow growth, and more."
    elif 18.5 <= bmiCalc < 25:
        return "You are normal weight, but yuou still must continue to take care of your body."
    elif 25 <= bmiCalc < 30:
        return "You must begin to workout and start moving around more. Your body is at risk to cardiovascular disease, other types of diseases, diabetes, and different type of cancers."
    else:
        return "You must see a healthcare professional and figure out what health concerns you are at risk of and need to fix. Some risks are high blood pressure, heart disease, liver disease,  high cholesterol, more."

operate = []

while True:
    weight = float(input("Enter your weight (in pounds): "))
    feet = int(input("Enter your height (in feet): "))
    inches = int(input("Enter your inches that are left in the feet of your height: "))
    
    height = (feet*12)+inches
    
    bmiCalc = bmi(weight, height)
    group = describe(bmiCalc)
    improve = improvement(bmiCalc)
    concern = health_concerns(bmiCalc)
    
    operate.append(bmiCalc)
    
    print("")
    print("Your BMI is: ", round(bmiCalc, 2))
    print("Your BMI shows: ", group)
    print("You should improve: ", improve)
    print("")
    print("Your health care concern you should address is: ", concern)
    print("")
    
    progress = input("Do you want to calculate your BMI again? ")
    if progress.lower() != "yes":
        break
        
print("Your BMI progress is: ", operate)
    
Enter your weight (in pounds): 212
Enter your height (in feet): 5
Enter your inches that are left in the feet of your height: 6

Your BMI is:  34.21
Your BMI shows:  You are obese.
You should improve:  You should go see a healthcare professional and doctor in order to balance your health.

Your health care concern you should address is:  You must see a healthcare professional and figure out what health concerns you are at risk of and need to fix. Some risks are high blood pressure, heart disease, liver disease,  high cholesterol, more.

In [ ]:
 
In [ ]:
#!/usr/bin/python

def bmi(weight, height): #Defining a function called bmi, which has the weight and height that calculates the bmi of the user.
    bmiCalc = (weight/(height**2))*703 #The bmiCalc is the calculation of the weight and height of the user in order to find out the bmi. 
    return bmiCalc #The return command sends the bmiCalc to the caller so the calculation will be executed once the variable is called.

#The numbers 18.5, 25, 30, are from the World Health Organization (WHO), who show that these numbers in kilograms are guidelines to everyones health, which are based on the bmi of the person.

def describe(bmiCalc): #Defining a function called describe, which is describing the calculation bmiCalc which is the calculation of the bmi, so they are decribing the bmi.
    if bmiCalc < 18.5: #This statement shows that if the bmi calculation is less than 18.5 kg it is comparing numbers to show if the users bmi is less than or greater than 18.5. 
        return "You are underweight." #This return command shows that if the if statement is true, then the return statement will printed. This means if bmi is less than 18.5, then it will allow the user to print out what the return command displays. 
    elif 18.5 <= bmiCalc < 25: #This statement shows that if the about if statement is not true then the elif statements will be executed until it is true. The elif statement shows that is the bmi is greater than or equal to 18.5 and less than 25, it will be true and will display the code once the function is called.
        return "You are normal weight." #This return command shows that if the elif statement is true then the bmi is normal weight and informs the user of their bmi.
    elif 25 <= bmiCalc < 30: #This elif statement shows that is the bmi is greater than or equal to 25 and less than 30 than it will show the user which group their bmi falls into. This statement must be true for the code return command to be executed. 
        return "You are overweight." #This return command show that if this elif statment is true then it will show the user that they are overweight in order to inform them of what their bmi shows and what group they fall into.
    else: #This else statement shows that if the if and elif statements are false then the else statement will be executed.
        return "You are obese." #If all of the statements are false then the user's bmi is greater than 30, which shows that they are obese and this number falls into a group to inform the user of their bmi. 

def improvement(bmiCalc): #Defining a function called improvement to show how the user can improve their bmi by giving them recommendations. 
    if bmiCalc < 18.5: #This is an if statement that will be executed if it is true, so if the bmi of the user is less than 18.5.
        return "Try to gain more weight by eating healthy and working out!" #This return command will be displayed when the function is called and if the if statement is true to show recommedations to the user. This will display advice for the user to gain more weight if they are below 18.5 kg.
    elif 18.5 <= bmiCalc < 25: #This elif statement shows that if the bmi of the user is greater than or equal to 18.5 and less than 25 then the return statement will be displayed once the function is called.
        return "Try to stay healthy and keep up taking care of your body!" #This return command shows that the user is normal weight and to encourage them to stay healthy and keep taking care of their body. 
    elif 25 <= bmiCalc < 30: #This is an elif statement that shows if the users bmi is greater than or equal to 25 and less than 30 then it will be displayed. 
        return "You should learn how to balance your diet and eat less. Make sure you monitor what you are eating in order to stay healthy! Take care of your body too." #This is a return command that will be displayed if the elif statement is true to show the user they are overweight and must workout and lose weight in order to take care of their body.
    else: #This elif statement will be executed if all the other if and elif statement are false. 
        return "You should go see a healthcare professional and doctor in order to balance your health." #This is a return command and will display the user to see a healthcare professional since their bmi is above 30, which shows that they are obese. This command will be executed if the other if and elif statements are false. 

def health_concerns(bmiCalc): #Defining a function called health_concerns in order to show the user how their bmi may be causing problems throughout their body.
    if bmiCalc < 18.5: #This if statement shows if the bmi of the user is less than 18.5, then it wil be true. 
        return "You must gain more weight. You are putting your body at risk to diseases, vitiman deficiencies, slow growth, and more." #This return command will display if the if statement is true that the user's bmi shows that they must gain more weight because they might have health concerns, such as vitiman deficiencies.
    elif 18.5 <= bmiCalc < 25: #This elif statement will be executed if the user's bmi is greater than or equal to 18.5 and if it is less than 25. 
        return "You are normal weight, but yuou still must continue to take care of your body." #If the elif statement is true then the return command will display that the user is normal weight and should continue to take care of their body to protect them from any illnesses or diseases. 
    elif 25 <= bmiCalc < 30: #This elif statement shows and will be executed of the user's bmi is greater than or equal to 25 and less than 30. 
        return "You must begin to workout and start moving around more. Your body is at risk to cardiovascular disease, other types of diseases, diabetes, and different type of cancers." #This return statement shows that if the elif statement is true then the user will be informed of the health concerns their bmi brings because they fall into a group, which shows they are overweight.
    else: #This elif statement will be true if the other if and elif statement are false.
        return "You must see a healthcare professional and figure out what health concerns you are at risk of and need to fix. Some risks are high blood pressure, heart disease, liver disease,  high cholesterol, more." #The return command shows that the user's bmi will fall into the group obese which will give them advice to go see a healthcare professional and make sure they do not have any seriouis problems with their body. 

operate = [] #Operate is a created variable, which is a list that will be used throughout the program.

while True: #This is a while true loop, which will keep going and contains the main functions of the of program.
    weight = float(input("Enter your weight (in pounds): ")) #This is a variable called weight that has a float, so it allows the user to input their weight in pounds, which can be in decimal form. 
    feet = int(input("Enter your height (in feet): ")) #This is a variable called feet that is an integer, so it allows the user to input their height only the feet as an integer.
    inches = int(input("Enter your inches that are left in the feet of your height: ")) #This is a variable called inches, so it allows the user to input their inches when it can not be converted to feet since it is less than 12 inches. They will input this as an integer. 
    
    height = (feet*12)+inches #This variable called height calculates the feet into inches and then adds it to the left over inches so the height is in inches.
    
    bmiCalc = bmi(weight, height) #The function bmi of the weight and height of the user, is being equal to the variable called bmiCalc, so the bmi calculations.
    group = describe(bmiCalc) #This variable group allows the user to put in the function describe the bmi, which is the function above and contains more code. 
    improve = improvement(bmiCalc) #The variable improve allows the user to call the improvement function, which has a parameter of bmiCalc that has the calculations of the user's bmi. 
    concern = health_concerns(bmiCalc) #The variable concern allows the user to call the function, health_concerns, which contains also the user's bmi and figures out which category they fall into. 
    
    operate.append(bmiCalc) #The operate variable appends the bmi calculations, so it contains the users bmi in a list. 
    
    print("") #This is an empty print statement to create spacing for the code, so it is easy to read when it is outputted. 
    print("Your BMI is: ", round(bmiCalc, 2)) #This is a print statement, so it displays the user's bmi and it also rounds it, so it is easy for the user to read. 
    print("Your BMI shows: ", group) #This is a print statement that displays the user's bmi group, so what category the user falls into, such as underweight, normal weight, overweight, and obese. 
    print("You should improve: ", improve) #This is a print statement, so it displays the user's improvement based on what category they fall into. 
    print("") #An empty print statement to create spacing for the code, so it is easy to read.
    print("Your health care concern you should address is: ", concern) #This is a print statement, so it displays the user's health concern and what they should work on, which is based on their group. 
    print("") #This is an empty print statement to make the output of the code easy to read, so it creates spacing.
    
    progress = input("Do you want to calculate your BMI again? ") #This is a variable that allows the user to input if they what to calculate another bmi.
    if progress.lower() != "yes": #If the user's input is yes and the .lower() allows the user's to input Yes or yes. 
        break #This ends the while loop if the user does not want to run the program again. 
        
print("Your BMI progress is: ", operate) #This print statement displays and contains the user's bmi progress so if they do another bmi and the operate variable contains the user's bmi.