Quiz Space

Modern Application Development I · Quiz 2 · 1 Dec 2024 · September 2024 term

Question 5: Consider the following flask application. app.py Which of…

Question 5

+3 marksOne or more correct options

Consider the following flask application.

app.py

python
from flask import Flask, abort, request
app = Flask(__name__)
data = {'PDSA':'CS2003', 'DBMS':'CS2004', 'Java':'CS2005'}
@app.route('/course/<course_name>')
def course(course_name):
course_id = request.args.get('id')
if course_name in data and course_id == data[course_name]:
return f'<h1>The Course ID for {course_name} is: {course_id}</h1>'
else:
abort(400, "Bad Request: Invalid data")
app.run(debug=True)

Which of the following statements is/are true if the application is running locally on http://127.0.0.1:5000 ?

Select all that apply.

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

Correct answers

  • A
  • B
  • D

Question 5 of 16 in the IIT Madras BS Modern Application Development I (MAD 1) Quiz 2 paper sat on 1 Dec 2024, in the September 2024 term (IIT M DIPLOMA AN EXAM QDD2 01 Dec 2024). It carries 3 marks.

More questions from this paper

  1. Q1You have a DRAM module with bus width of 64 bits, clock speed of 800 MHz, and operating in DDR (double-data-rate or two…
  2. Q2Figure question
  3. Q3Consider the following python code. Consider that the above code is running locally on “http://127.0.0.1:5000”. What wi…
  4. Q4Consider the following flask application. app.py Which of the following statements is/are true if the application is ru…
  5. Q6Consider the following HTML document “form.html” and the flask route given in “app.py”. Assume all the required methods…
  6. Q7Consider the following flask code. If the flask server is running locally on “http://127.0.0.1:5000/”. Which of the fol…
  7. Q8Consider the flask code below. Assume that the above flask application is running on http://127.0.0.1:5000. Which of th…
  8. Q9Consider a character set Q, which consists of only those characters used in the sentence, "the five boxing wizards jump…
  9. Q10We are trying to create two models ‘Student’ and ‘Assignment’ and they are related by one-to- many relationship(i.e., o…
  10. Q11What will be returned on the terminal 2 for the command:
  11. Q12What will be returned on the terminal 2 for the command:
  12. Q13Which of the following statements are correct?
  13. Q14Identify the correct order of tasks that take place when a client makes a request on the URL: https://example.com/home.…
  14. Q15Consider the following statements and select the correct option.\ Statement 1: Redundancy is used to improve performanc…
  15. Q16The term “stateless” in the context of a server means that _