Question 16
Consider the following Flask code:
from flask import Flask, render_template, request
app = Flask(__name__)
@app.route('/login', method="GET")def login(id): name = request.form.get('name', 'Guest') return render_template("login.html", name=name)
if __name__ == '__main__': app.run(debug=True)login.html
<body> {{ name }} <form action="/login" method="POST"> <input type="text" name="name" placeholder="Enter your name"> <button type="submit">Submit</button> </form></body>Based on the above data, answer the given subquestions.