Quiz Space

Modern Application Development I · Quiz 2 · 3 Aug 2025 · May 2025 term

Question 6: Consider the following Python code. File name: main.py Wh…

Question 6

+3 marksOne correct option

Consider the following Python code.

File name: main.py

python
def calculate(funx):
def wrapper(a, b):
x = funx(a, b)
return x**2
return wrapper
@calculate
def foo(x, y):
return x - y
# main code
print(foo(5, 2))

What is the correct output of the given code?

  1. A

    10

  2. B

    9

  3. C

    3

  4. D

    4

Show answer

Correct answer

  • B

    9

Question 6 of 16 in the IIT Madras BS Modern Application Development I (MAD 1) Quiz 2 paper sat on 3 Aug 2025, in the May 2025 term (IIT M DEGREE AN EXAM QDB2 03 Aug 2025). It carries 3 marks.

More questions from this paper

  1. Q1You manage a datacenter where each server has a 10 Gigabit per second network connection and the facility’s backbone li…
  2. Q2Which of the following statements BEST describes a key advantage of Jinja2 server-side rendering over JavaScript/JSON-b…
  3. Q3Figure question
  4. Q4What is the right syntax to use an external JavaScript file(.js) into the current html file?
  5. Q5Figure question
  6. Q7Consider the following Python code snippet. Which of the following statements, when substituted in place of === OUTPUT …
  7. Q8Consider the following Flask app code. Assume the above flask app runs on “http://127.0.0.1:5000/” and is accessed thro…
  8. Q9Consider the following HTML code. Filename: main.html
  9. Q10Consider the following flask application. If the application is running locally on http://127.0.0.1:5000. What will be …
  10. Q11Which of the following statements is/are false about caching in REST APIs?
  11. Q12Which of the following is/are correct with respect to storing data in graphs?
  12. Q13Consider the Flask Restful API code given below: File name: app.py Assume that the Flask server is running on http://12…
  13. Q14Figure question
  14. Q15Consider the following sqlalchemy code and answer the given subquestions:
  15. Q16Consider the following sqlalchemy code and answer the given subquestions: