Quiz Space

Modern Application Development I · Quiz 2 · 23 Nov 2025 · September 2025 term

Question 4: Consider the following flask app. What will be the output…

Question 4

+3 marksOne correct option

Consider the following flask app.

python
from flask import Flask
app = Flask(__name__)
@app.route('/post/<int:id>')
@app.route('/post/<string:id>')
def post(id):
return f"Post ID: {id}"
@app.route('/post')
def all_posts():
return "All posts"
if __name__ == "__main__":
app.run()

What will be the output on the browser, if you visit 127.0.0.1:5000/post/23?

  1. A

    Post ID: 23

  2. B

    "All posts"

  3. C

    404 Not Found

  4. D

    Flask throws AssertionError

Show answer

Correct answer

  • A

    Post ID: 23

Video solution

The video solution to this question is being recorded and will play here. Until then, the answer key is above.

Question 4 of 16 in the IIT Madras BS Modern Application Development I (MAD 1) Quiz 2 paper sat on 23 Nov 2025, in the September 2025 term (IIT M DIPLOMA AN EXAM QDD2 23 Nov 2025 NEW). It carries 3 marks.

More questions from this paper

  1. Q1A client sends a signal to a satellite 36,000 km above Earth. Speed of electromagnetic waves in vacuum = 3 × 10⁸ m/s. C…
  2. Q2Consider the following flask app. What will be the output if you visit 127.0.0.1:5000/hello ?
  3. Q3Consider the following flask app. If a POST request is sent to 127.0.0.1:5000/data/5, what will be the output on the br…
  4. Q5Consider the following code:\ app.py You are running a Flask web application locally using the command: python app.py. …
  5. Q6Match the Flask-RESTful components with their correct description/role:
  6. Q7What happens if you don’t return a proper dictionary/JSON in Flask-Restful API methods?
  7. Q8Consider the following table. Which of the following matches is correct?
  8. Q9Consider the following Flask SQLalchemy code. What is true about the credits column?
  9. Q10Consider the following Flask code: File name: app.py If the app is running on <u>http://127.0.0.1:5000</u> and the calc…
  10. Q11Consider the following Flask code: File name: main.py Choose the different ways of executing “main.py” and rendering re…
  11. Q12Consider the URL:\ https://example.com:8080/index.html?user=admin#section2\ Which of the following is/are True?
  12. Q13Match the JavaScript event binding method with its correct description:
  13. Q14Consider the following JavaScript output methods. Which of these statements is/are true?
  14. Q15You are building a Flask-RESTful API with the following code: Which of the following statements is/are true?(Select all…
  15. Q16Consider the following table students: Which of the following SQL queries will return the names of students who are 20 …