Examveda

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: Option D


This Question Belongs to Python Program >> Dictionary In Python

Join The Discussion

Related Questions on Dictionary in Python