Compare and contrast dictionaries (dicts) with other Python data types.

Question :

Compare and contrast dictionaries (dicts) with other Python data types.

(a) Dictionaries are a container type that store data, like lists and tuples.
(b) Dictionaries are a mapping data type indexed by text (keys). The dictionary's elements (the items it contains) are key:value pairs. In contrast, lists and tuples store data by using numeric indexes (they are sequence data types) and support indexing and slicing.
(c) Dictionaries are mutable. That means, a dictionary can be modified in place; we do not have to create a copy of it to modify it (as we do with strings and tuples ). However, a dict's keys must be immutable.


Similar Questions


CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz