CBSE Class 11 Computer Science Question 5 of 112

Dictionaries — Question 5

Back to all questions
5
Question

Question 5

How is indexing of a dictionary different from that of a list or a string?

Answer

In lists or strings, the elements are accessed through their index where as in dictionaries, the elements are accessed through the keys defined in the key:value pairs. Moreover, lists and strings are ordered set of elements but dictionaries are unordered set of elements so its elements cannot be accessed as per specific order.