# 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
def main():
print("***** Welcome to BMI Calculator***** \n")
weight = float(input("Enter your weight in pounds: "))
height = float(input("Enter your height in inches: "))
def bmi_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):
return f"\nYour BMI is {bmi} you are below the healthy range."
elif (bmi >= 19) and (bmi <= 25):
return f"\nYour BMI is {bmi} you are in the healthy range."
elif (bmi > 25):
return f"\nYour BMI is {bmi} you are above the healthy range."
else:
return f"\nCheck your entries something went wrong."
print(bmi_calculator(weight, height))
if __name__ == '__main__':
main()
![Cover image for BMI Calculator](https://media.dev.to/cdn-cgi/image/width=1000,height=420,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fonp3blgbqrg2xj3qy3b9.jpg)
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)