Quiz Space

Modern Application Development I · Quiz 2 · 3 Dec 2023 · September 2023 term

Question 14: What will be the output of the following Python code sni…

Question 14

+3 marksOne correct option

What will be the output of the following Python code snippet?

python
def modify(func):
def wrapper(n):
mylist = []
for i in range(1, n + 1):
if n%i == 0:
mylist.append(i)
return mylist
return wrapper
@modify
def myFunc(n):
mylist = []
for i in range(1, n + 1):
if i%2 == 0:
mylist.append(i)
return mylist
print(myFunc(14))
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • C

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

More questions from this paper

  1. Q1Consider the schema for the 'student' table created in SQLite database using flask-sqlalchemy. What will be the output …
  2. Q2Consider the following flask application. If the application is running locally on http://127.0.0.1:5000. What will be …
  3. Q3Consider the following flask app. Given that test_request_context() allows text to be printed on the terminal, which of…
  4. Q4Consider the following flask application. app.py Which of the following statements is/are true if the application is ru…
  5. Q5In the context of in-memory databases, what is the primary function of an index?
  6. Q6Consider the following python code snippet. What is the generated output on python console?
  7. Q7In the context of API documentation, what is typically provided to describe the available endpoints, request parameters…
  8. Q8Consider the models "Channel" and "Video" used to create the tables "channel" and "video" in SQLite database using flas…
  9. Q9Consider the models "Channel" and "Video" used to create the tables "channel" and "video" in SQLite database using flas…
  10. Q10Figure question
  11. Q11If the app first receives the request, what will be the final output on the shell after writing the following lines of …
  12. Q12Consider a client which is located 3000 km from the server makes a request through the cable. Suddenly after the reques…
  13. Q13The throughput of a Solid State Device (SSD) is 180 MB/sec. If it is to be replaced by a standard HDD whose lens can re…
  14. Q15Consider the following flask view function defined to add a product and select correct statement(s).
  15. Q16Consider the following Python code snippet. Filename: log.py Which of the following statements is/are correct?