Question 1
Which of the following python versions introduced dictionary comprehension?
Question 2
Which of the following statements is true regarding dictionary comprehension?
Question 3
What does the following dictionary comprehension do?
{k: k**2 for k in range(1,6)}
Question 4
What is the advantage of using dictionary comprehension over traditional methods of creating dictionaries?
Question 5
What is the basic structure of a dictionary comprehension?
Question 6
What is the result of the following dictionary comprehension?
{k: v for k, v in {a: 1, b: 2, c: 3}.items() if v > 1}
Question 7
Which symbol is used to enclose a dictionary comprehension in python?
Question 8
In a dictionary comprehension, what does the key represent in the expression key: value?
Question 9
How can you conditionally include items in a dictionary comprehension?
Question 10
What is dictionary comprehension in python?