Vidyalelo
Python · Q61

MCQs for Python Dictionaries: Exam

Programming · Python · question 61

Q61

What will be the output of the following Python code? >>> a=i: i*i for i in range(6) >>> a

A.
Dictionary comprehension doesn't exist
B.
{0: 0, 1: 1, 2: 4, 3: 9, 4: 16, 5: 25, 6:36}
C.
{0: 0, 1: 1, 4: 4, 9: 9, 16: 16, 25: 25}
D.
{0: 0, 1: 1, 2: 4, 3: 9, 4: 16, 5: 25}
Answer

Answer: Option D

Solution

Answer: Option D
No explanation is given for this question Let's Discuss on Board