Quiz Space

Modern Application Development I · Quiz 1 · 16 Oct 2022 · September 2022 term

Question 3: Consider the following Python code snippet. What will be …

Question 3

+2 marksOne correct option

Consider the following Python code snippet.

python
from jinja2 import Template
temp = """{% for num in seq|reject("even") %}
{{ num+2 }}
{% endfor %}
"""
seq = [6,5,71,13,30,22]
output = Template(temp)
print(output.render(seq = seq))

What will be the output if the given code is executed?

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • C

Question 3 of 17 in the IIT Madras BS Modern Application Development I (MAD 1) Quiz 1 paper sat on 16 Oct 2022, in the September 2022 term (IIT M QUIZ 1 FOUNDATION DAD DIPLOMA QPD2 16 Oct 2022). It carries 2 marks.

More questions from this paper

  1. Q1Figure question
  2. Q2Figure question
  3. Q4Consider the following Python code snippet. (Concept: Python string and Jinja2 templates) What will be the output on th…
  4. Q5Consider the code snippets given below.\ (Concept: HTML and CSS) File 1: index.html: File 2: style.css: What will be re…
  5. Q6Consider the following Python code given below. (Concept: Flask and concepts of HTTP methods) If the above flask applic…
  6. Q7Figure question
  7. Q8Figure question
  8. Q9Figure question
  9. Q10Consider the below HTML and CSS styling. Assuming clicking the button with the text “Click Me” removes the class “conte…
  10. Q11Figure question
  11. Q12Figure question
  12. Q13Figure question
  13. Q14Which of the following option(s) will generate the HTML code equivalent to the below HTML code? [Concepts covered: Prog…
  14. Q15Figure question
  15. Q16Based on the above data, answer the given subquestions.
  16. Q17What S_Id(s) is/are returned by the following SQL query for the given instance of the relational tables?