Examveda

What will be the output of the following Python code?
>>> import collections
>>> a=collections.OrderedDict((str(x),x) for x in range(3))
>>> a

A. {'2':2, '0':0, '1':1}

B. OrderedDict([('0', 0), ('1', 1), ('2', 2)])

C. An exception is thrown

D. ' '

Answer: Option B


This Question Belongs to Python Program >> Dictionary In Python

Join The Discussion

Related Questions on Dictionary in Python