Quiz Space

Modern Application Development I · Quiz 2 · 4 Aug 2024 · May 2024 term

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

Question 15

+2 marksOne or more correct options

Consider the following flask application.

app.py

python
from flask import Flask, abort, request
app = Flask(__name__)
@app.route('/login/<id>')
def login(id):
if id:
if id.isalpha():
abort(400, "Bad Request: Invalid ID")
return f'<h1>Your ID is: {id}</h1>'
return f'<h1>Invalid ID</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 15 of 16 in the IIT Madras BS Modern Application Development I (MAD 1) Quiz 2 paper sat on 4 Aug 2024, in the May 2024 term (IIT M DIPLOMA AN EXAM QDD2 4 Aug 2024). It carries 2 marks.

More questions from this paper

  1. Q1Read the statements given below carefully and select the correct option.\ Statement 1: The GET method is the same as th…
  2. Q2Consider the below flask_sqlalchemy data models “Product”, “Supplier” and “Supply” given in the code below. What will b…
  3. Q3A certain video on the web occupies 3 gigabytes of memory of the server. If the number of viewers of the video over tim…
  4. Q4Consider the following Python code. app.py Using MaxScores data model in the above “app.py”. What is the correct sequen…
  5. Q5Consider the following Python code snippet, and select the correct output list if the code is run on the terminal.
  6. Q6Consider the following flask application. If the application is running locally on http://127.0.0.1:5000 then which of …
  7. Q7Consider the following code. Assume that the above flask code is running locally on http://127.0.0.1:5000/ . Which of t…
  8. Q8Consider the following flask application running locally on http://127.0.0.1:5000 app.py Based on the above data, answe…
  9. Q9Consider the following flask application running locally on http://127.0.0.1:5000 app.py Based on the above data, answe…
  10. Q10If the flask application is running locally on URL http://127.0.0.1:5000. Select the appropriate options for the given …
  11. Q11If the flask application is running locally on URL http://127.0.0.1:5000. Select the appropriate options for the given …
  12. Q12You have a DRAM module with bus width of 64 bits, clock speed of 400 MHz, and operating in DDR (double-data-rate or two…
  13. Q13Figure question
  14. Q14Consider the following Python code snippet. Filename: code.py What will be output on the terminal is the above code sni…
  15. Q16Consider the following HTML Document and select the correct statement(s) from the following if a user types the passwor…