Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from flask import Flask, request, render_template
- app = Flask(__name__)
- @app.route('/', methods =['GET', 'POST'])
- def index():
- bmi = 0
- if request.method == 'POST' and request.form.get('weight') and request.form.get('height'):
- weigtht = float(request.form.get('weight'))
- heigtht = float(request.form.get('height'))
- bmi = weigtht* heigtht
- return render_template('index.html', bmihtml = bmi)
- return render_template('index.html')
- app.debug = True
- app.run('0.0.0.0')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement