Examveda

What will be the output of the following Python code?
>>> a={i: 'A' + str(i) for i in range(5)}
>>> a

A. An exception is thrown

B. {0: 'A0', 1: 'A1', 2: 'A2', 3: 'A3', 4: 'A4'}

C. {0: 'A', 1: 'A', 2: 'A', 3: 'A', 4: 'A'}

D. {0: '0', 1: '1', 2: '2', 3: '3', 4: '4'}

Answer: Option B


This Question Belongs to Python Program >> Dictionary In Python

Join The Discussion

Related Questions on Dictionary in Python