Skip to content

format code with autopep8 #2819

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions BMI Calculator/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -17,6 +19,7 @@ def interpret_bmi(bmi):
else:
return "Obese"


@app.route("/", methods=["GET", "POST"])
def index():
if request.method == "POST":
Expand All @@ -30,5 +33,6 @@ def index():

return render_template("index.html")


if __name__ == "__main__":
app.run(debug=True)