Quiz Space

Modern Application Development I · Quiz 2 · 24 Mar 2024 · January 2024 term

Question 11: Consider the following flask application. app.py Which o…

Question 11

+3 marksOne or more correct options

Consider the following flask application.

app.py

python
from flask import Flask, abort, request
app = Flask(__name__)
@app.route('/validate/<int:number>')
def validate_number(number):
if number % 2 == 0 and number % 3 == 1:
abort(400, "Bad Request: Invalid number provided")
return f'<h1>Valid Number: {number}</h1>'
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

  • C
  • D

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

More questions from this paper

  1. Q1Consider the following code. If the flask application is running on <u>http://127.0.0.1:5000</u>, what will browser ren…
  2. Q2Consider the following Flask code snippet. If the application is running on a local server for the URL: https://127.0.0…
  3. Q3Consider the below statements about Cookies:\ Statement 1: Cookies enable the web app to recognize the users\ Statement…
  4. Q4Consider the below Flask code snippet: If the application is running locally, what will be the status code and mimetype…
  5. Q5Consider a character set M, which consists of only those characters used in the statement, "sphinx of black quartz judg…
  6. Q6Consider the following Python code snippet. Which of the following statements, when substituted in place of === OUTPUT …
  7. Q7Figure question
  8. Q8Figure question
  9. Q9Consider the following Python code snippet. What will be the output of the code on the terminal?
  10. Q10Consider the following Python code snippet. What will be the output of the above code on the terminal for the command:
  11. Q12Consider the following flask application. app.py Which of the following statements is/are true if the application is ru…
  12. Q13Consider the following flask application. app.py Which of the following statements is/are true if the application is ru…
  13. Q14Figure question
  14. Q15Consider the following HTML document and select the correct option(s).
  15. Q16Consider the following api resources created using flask_restful. Assume that the app is connected to the database and …