-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
34 lines (28 loc) · 1.12 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from flask import Flask, render_template, request
app = Flask(__name__)
@app.route("/")
def main():
return render_template("main.html")
@app.route('/age_checker', methods=["GET", "POST"])
def age_checker():
if request.method == "GET":
return render_template("age_checker.html")
elif request.method == "POST":
first = request.form['1st_person']
second = request.form['2nd_person']
third = request.form['3rd_person']
young = None
old = None
if ((first < second and first < third) and (first != second and first != third)):
young = first
elif ((second < first and second < third) and (second != first and second != third)):
young = second
else:
young = third
if ((first > second and first > third) and (first != second and first != third)):
old = first
elif ((second > first and second > third) and (second != first and second != third)):
old = second
else:
old = third
return render_template("result.html", young= young, old= old)