diff --git a/BMI Calculator/app.py b/BMI Calculator/app.py index 09ae3c3c5b..e19fa00a7c 100644 --- a/BMI Calculator/app.py +++ b/BMI Calculator/app.py @@ -2,11 +2,13 @@ app = Flask(__name__) + def calculate_bmi(weight, height): height_in_meters = height / 100 bmi = weight / (height_in_meters ** 2) return bmi + def interpret_bmi(bmi): if bmi < 18.5: return "Underweight" @@ -17,6 +19,7 @@ def interpret_bmi(bmi): else: return "Obese" + @app.route("/", methods=["GET", "POST"]) def index(): if request.method == "POST": @@ -30,5 +33,6 @@ def index(): return render_template("index.html") + if __name__ == "__main__": app.run(debug=True)