Quiz Space

Modern Application Development I · Quiz 1 · 7 Jul 2024 · May 2024 term

Question 13: Consider the following flask app and the bodies of two i…

Question 13

+4.5 marksOne correct option

Consider the following flask app and the bodies of two index.html files shown in the figure below.

app.py

python
from flask import Flask, render_template
import sys
app = ========= app object initialization here ===========
@app.route('/home')
def home():
return render_template('index.html')
app.run()

app_templates/index.html

html
<h3>Home page</h3>
<p>MAD I focuses on backend development</p>
<h5>IITM ONLINE DEGREE</h5>

root_templates/index.html

html
<h3>Home page</h3>
<p>Vue JS is a frontend technology</p>
<h5>IITM BS DEGREE</h5>

If the app is run locally using the command
python app.py root_templates app_templates,
and the output on browser for URL http://127.0.0.1/home is:

Home page

Vue JS is a frontend technology

IITM BS DEGREE

How should the app be initialized to get the desired output on the browser?

  1. A
  2. B
  3. C
  4. D
  5. E
Show answer

Correct answer

  • D

Question 13 of 16 in the IIT Madras BS Modern Application Development I (MAD 1) Quiz 1 paper sat on 7 Jul 2024, in the May 2024 term (IIT M DIPLOMA AN EXAM QDD2 7 July 2024). It carries 4.5 marks.

More questions from this paper

  1. Q1Which of the following is not a correct perceivable accessibility principle?
  2. Q2Which of the below HTTP status codes represents the client error?
  3. Q3What will be the output of the following Python code?
  4. Q4Consider the below table. Use the above table. Which of the below match is correct?
  5. Q5A certain movie with advertisements is being streamed by the client on the internet with a bandwidth of 5 Mbps. If the …
  6. Q6Figure question
  7. Q7The following Python code snippet generates the output on the terminal. Which of the following is the correct output?
  8. Q8Consider the following HTML document. What will be the rendered output if an additional style is added via the ID selec…
  9. Q9Consider the following Python code snippet. Filename: app.py If the above flask app is run using the command python app…
  10. Q10Consider the following Python code snippet. Filename: module.py How will the browser render the output of the above cod…
  11. Q11Consider the following HTML document. How will the browser render above HTML file?
  12. Q12Consider a client A that makes a request to server B that fetches the information from Datacenter C which in turn fetch…
  13. Q14What can be inferred from the Entity-Relationship Diagram below:
  14. Q15Consider the following Flask code. File name: sum_args.py Select the command(s) to execute the above code without any e…
  15. Q16Consider the following Python code and HTML document. HTML document: templates/index.html Assume that the flask server …