Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from flask import Flask, request
- app = Flask(__name__)
- @app.route('/hello')
- def hello():
- res = 0
- slova = 'Я могу найти за тебя дискриминант, только введи данные.'
- if 'a' in request.args:
- if'b' in request.args:
- if'c' in request.args:
- res=int(request.args['b'])*int(request.args['b'])-4*int(request.args['a'])*int(request.args['c'])
- slova = int(res)
- return """
- <html>
- <body>
- <p>{}</p>
- <p>{}</p>
- D = b^2 - 4*a*c
- <form action='/hello' method='GET'>
- a: <input type="text" name="a" /><br>
- b: <input type="text" name="b" /><br>
- c: <input type="text" name="c" /><br>
- <input type="submit" value="ОК!" />
- </form>
- </body>
- </html>
- """.format(slova,res)
- app.run(debug=True, port=8080)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement