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.


CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad