Modern Application Development I, Quiz 2
Consider the following code.
from flask import Flaskapp = Flask(__name__)
@app.route('/home')def home1(): return "This is homepage 1"
@app.route('/home/')def home2(): return "This is homepage 2"
@app.errorhandler(404)def page_not_found(e): return 'page not found'
app.run(debug=True)If the flask application is running on http://127.0.0.1:5000, what will browser render for URL http://127.0.0.1:5000/home/
Consider the following code. from flask import Flask app = Flask(__name__) @app.route('/home') def home1(): return "This is homepage 1" @app.route('/home/') def home2(): return "This is homepage 2" @app.errorhandler(404) def page_not_found(e): return 'page not found' app.run(debug=True) If the flask application is running on <u>http://127.0.0.1:5000</u>, what will browser render for URL <u>http://127.0.0.1:5000/home/</u> Consider the following Flask code snippet. from flask import Flask, request app = Flask(__name__) @app.route('/greet/<name>') def greet(name): if name: return f'<h1>Hi, Mr/Ms/ {name} welcome to flask</h1>' else: return f'<h1>Hi, Mr/Ms/ <Unknown> welcome to flask</h1>' app.run(debug=True) If the application is running on a local server for the URL: https://127.0.0.1:5000, what will the browser render for the URL, http://127.0.0.1:5000/greet/? Consider the below statements about Cookies:\ **Statement 1**: Cookies enable the web app to recognize the users\ **Statement 2**: Cookies can include information about location, login data, and language etc., Which of the below is the correct option?