Quiz Space

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

Question 5: Consider the following Python code snippet, and select th…

Question 5

+3 marksOne correct option

Consider the following Python code snippet, and select the correct output list if the code is run on the terminal.

python
def modify(func):
def wrapper(l):
res = func(l)
return res[::-1]
return wrapper
def update(func):
def wrapper(l):
res = func(l)
return list(map(lambda x: x/2,res))
return wrapper
@modify
@update
def mylist(l):
out_list = []
for i in l:
out_list.append(i**2)
return out_list
print(mylist([2,4,1,7,5,9]))
  1. A

    [0.25, 1, 4, 6.26, 12.25, 20.25]

  2. B

    [1, 4, 0.25, 12.25, 6.25, 20.25]

  3. C

    [40.5, 12.5, 24.5, 0.5, 8.0, 2.0]

  4. D

    [0.5, 2.0, 8.0, 12.5, 24.5, 40.5]

Show answer

Correct answer

  • C

    [40.5, 12.5, 24.5, 0.5, 8.0, 2.0]

Question 5 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 3 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. Q6Consider the following flask application. If the application is running locally on http://127.0.0.1:5000 then which of …
  6. Q7Consider the following code. Assume that the above flask code is running locally on http://127.0.0.1:5000/ . Which of t…
  7. Q8Consider the following flask application running locally on http://127.0.0.1:5000 app.py Based on the above data, answe…
  8. Q9Consider the following flask application running locally on http://127.0.0.1:5000 app.py Based on the above data, answe…
  9. Q10If the flask application is running locally on URL http://127.0.0.1:5000. Select the appropriate options for the given …
  10. Q11If the flask application is running locally on URL http://127.0.0.1:5000. Select the appropriate options for the given …
  11. 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…
  12. Q13Figure question
  13. Q14Consider the following Python code snippet. Filename: code.py What will be output on the terminal is the above code sni…
  14. Q15Consider the following flask application. app.py Which of the following statements is/are true if the application is ru…
  15. Q16Consider the following HTML Document and select the correct statement(s) from the following if a user types the passwor…