Quiz Space

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

Question 31: Consider the following flask application running locally…

Question 31

+4.5 marksOne or more correct options

Consider the following flask application running locally on http://127.0.0.1:5000

app.py

python
from flask import Flask, request
import sys
app = Flask(__name__)
data = ["Java", "Application Development","DBMS"]
@app.route('/course')
def home():
course = request.args.get('course')
if course in sys.argv[1]:
if sys.argv[1] in data:
return f"Welcome to {sys.argv[1]}!"
return f"Welcome to {course}!"
else:
return "Invalid Data"
app.run(debug=True)

Based on the above data, answer the given subquestions.

Select all that apply.

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

Correct answers

  • B
  • D

Question 31 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 the following Python code snippet.
  2. Q2Consider the following HTML document. How will the browser render above HTML file?
  3. Q3Consider the following flask application.
  4. Q4Figure question
  5. Q5Consider a function func, and a set of test cases given below. Filename: test_file.py What will be the output on the te…
  6. Q6The lens of an HDD can read data on the rotating disk with the speed of 42,000 bits per second. The disk is designed su…
  7. Q7Consider the below two python files code snippets app.py and test_app_route.py. app.py test_app_route.py: Assume that a…
  8. Q8Consider the following flask resource created using flask_restful. If the application is running locally on http://127.…
  9. Q9A flask application shown below is running locally on http://127.0.0.1:5000. If the application is running locally on h…
  10. Q10Consider the following flask application. Python file: app.py Template file: profile.html If the application is running…
  11. Q11Consider the following models Library and Book corresponding to tables library and book in SQLite database. Based on th…
  12. Q12Read the statements given below carefully and select the correct option.\ Statement 1:If an element having an ID and a …
  13. Q13Consider the following Python code snippet. log.py What will be the output on the terminal for the command: python log.…
  14. Q14Consider the following graph that represents the variation in bandwidth of a network for an entire day (24 hours). Thre…
  15. Q15Consider the below flask application. If you run the flask application using a terminal. What will be the output in the…
  16. Q16Figure question
  17. Q17Consider the following flask app and Jinja2 template. app.py index.html If the flask app is running locally on http://1…
  18. Q18Figure question
  19. Q19Consider the following python code snippet app.py, the HTML files, base.html and home.html residing in “templates” fold…
  20. Q20You have a DRAM module with bus width of 64 bits, clock speed of 2 GHz, and operating in DDR (double-data-rate or two v…
  21. Q21Figure question
  22. Q22Which of the following is true about the term “stateless” in the client-server model?
  23. Q23Consider the following Python code snippet “code.py”. Filename: code.py Which of the following will be the correct comm…
  24. Q24Consider the following flask application. app.py Which of the following statements is/are true if the application is ru…
  25. Q25Consider the following flask application. If the application is running locally on http://127.0.0.1:5000 then which of …
  26. Q26Consider the following flask_sqlalchemy data models “User” and “Role”. python shell: If the above commands are run in t…
  27. Q27Suppose a request https://xyz.com?name=amey&age=34 generates the below response on the browser’s console, The definitio…
  28. Q28Consider the following function to be tested and test functions given in the Python code snippet below. test_file.py On…
  29. Q29Consider the following flask application. If the application is running locally on http://127.0.0.1:5000, select the co…
  30. Q30Consider the following code snippet. Assume the database has a "student" table which has a TEXT column "student_id". If…
  31. Q32Consider the following flask application running locally on http://127.0.0.1:5000 app.py Based on the above data, answe…