# bmi_calc.py
# This program calculates a person's BMI and prints a message telling
# whether they are above, within, or below the healthy range.
# by: Scott Gordon
defmain():print("***** Welcome to BMI Calculator***** \n")weight=float(input("Enter your weight in pounds: "))height=float(input("Enter your height in inches: "))defbmi_calculator(weight,height):"""This program calculates a person's BMI and prints a message telling
whether they are above, within, or below the healthy range."""bmi=(weight*720)/(height**2)if (bmi>0)and(bmi<19):returnf"\nYour BMI is {bmi} you are below the healthy range."elif (bmi>=19)and(bmi<=25):returnf"\nYour BMI is {bmi} you are in the healthy range."elif (bmi>25):returnf"\nYour BMI is {bmi} you are above the healthy range."else:returnf"\nCheck your entries something went wrong."print(bmi_calculator(weight,height))if__name__=='__main__':main()
Top comments (0)