We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9b91a39 commit e1615aaCopy full SHA for e1615aa
BMI Calculator/app.py
@@ -2,11 +2,13 @@
2
3
app = Flask(__name__)
4
5
+
6
def calculate_bmi(weight, height):
7
height_in_meters = height / 100
8
bmi = weight / (height_in_meters ** 2)
9
return bmi
10
11
12
def interpret_bmi(bmi):
13
if bmi < 18.5:
14
return "Underweight"
@@ -17,6 +19,7 @@ def interpret_bmi(bmi):
17
19
else:
18
20
return "Obese"
21
22
23
@app.route("/", methods=["GET", "POST"])
24
def index():
25
if request.method == "POST":
@@ -30,5 +33,6 @@ def index():
30
33
31
34
return render_template("index.html")
32
35
36
37
if __name__ == "__main__":
38
app.run(debug=True)
0 commit comments