Quiz Space

Modern Application Development I · End Term · 1 Sept 2024 · May 2024 term · Set QDF3

Question 30: Consider the following flask application. If the applica…

Question 30

+4.5 marksOne or more correct options

Consider the following flask application.

python
from flask import Flask, abort
app = Flask(__name__)
modules = ['python', 'react', 'node']
@app.route('/home/modules')
def all_modules():
return f"<h3>List of modules: {modules}</h3>"
@app.route('/get/<string:module_1>/')
def get_module(module_1):
if module_1 in modules:
return f"<h3>One module found: {module_1}.</h3>"
else:
abort(400)
@app.errorhandler(400)
def module_error(error):
return "<h3>Cannot find module</h3>"
@app.errorhandler(404)
def module_error(error):
return "<h3>Incorrect Path</h3>"
app.run(debug=True)

If the application is running locally on http://127.0.0.1:5000, select the correct statement(s).

Select all that apply.

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

Correct answers

  • C
  • D

Question 30 of 32 in the IIT Madras BS Modern Application Development I (MAD 1) End Term paper sat on 1 Sept 2024, in the May 2024 term (IIT M FOUNDATION DIPLOMA AN EXAM QDF3 01 Sep 2024). It carries 4.5 marks.

More questions from this paper

  1. Q1Consider that you have installed some python packages using requirements.txt. Which command you will use to list the in…
  2. Q2A certain text document consisting of only alphanumeric characters (including spaces) takes 1,52,000 bits, when encoded…
  3. Q3The ability of an application to work with different input modalities beyond keyboard highlights which of the following…
  4. Q4Consider the following Python code snippet “code.py”. Filename: code.py Which of the following will be the correct comm…
  5. Q5Consider the following flask app and Jinja2 template. app.py index.html If the flask app is running locally on http://1…
  6. Q6Figure question
  7. Q7Figure question
  8. Q8Consider the following HTML document with an embedded style sheet. Which of the following figures correctly represents …
  9. Q9Figure question
  10. Q10Figure question
  11. Q11Figure question
  12. Q12Consider the following HTML document. How will the browser render above HTML file?
  13. Q13Figure question
  14. Q14Consider the following python code snippet app.py, the HTML files, base.html and home.html residing in “templates” fold…
  15. Q15Consider the below two python files code snippets app.py and test_app_route.py. app.py test_app_route.py: Assume that a…
  16. Q16You have a DRAM module with bus width of 8 bits, clock speed of 1.4 GHz, and operating in DDR (double-data-rate or two …
  17. Q17Consider the following flask resource created using flask_restful. If the application is running locally on http://127.…
  18. Q18A flask application shown below is running locally on http://127.0.0.1:5000. If the application is running locally on h…
  19. Q19Consider the following flask application. Python file: app.py Template file: profile.html If the application is running…
  20. Q20A server, using the inbuilt http module of Python, is running for a directory My_app whose file structure and content o…
  21. Q21The lens of an HDD can read data on the rotating disk with the speed of 56,000 bits per second. The disk is designed su…
  22. Q22Consider a function remainder, and a set of test cases given below. Filename: test_file.py What will be the output on t…
  23. Q23Consider the following Python code snippet. log.py What will be the output on the terminal for the command: python log.…
  24. Q24Consider the below flask application. If you run the flask application using a terminal. What will be the output in the…
  25. Q25Consider the following flask application. app.py Which of the following statements is/are true if the application is ru…
  26. Q26Which of the following statements is/are true about indexing?
  27. Q27Consider the following Model for Student. Which of the following methods from the Flask-sqlalchemy query will behave th…
  28. Q28Consider the following flask application. If the application is running locally on http://127.0.0.1:5000 then which of …
  29. Q29Consider the following function to be tested and test functions given in the Python code snippet below. test_file.py On…
  30. Q31At what distance (kms) should the router be placed from the client so that round-trip latency of the network remains as…
  31. Q32What will be the round-trip latency (milliseconds) of the network if the router is placed at exactly midway from the cl…