Dictionaries
Dictionaries
What is a Dictionary?
• Dictionary in Python is an unordered collection of data
values, used to store data values like a map, which unlike
other Data Types that hold only single value as an element.
• Dictionary holds a pair of values, one being the Key and the
other corresponding pair element being its key-value.
What is a Dictionary?
• Dictionary in Python is an unordered collection of
data values, used to store data values like a map,
which unlike other Data Types that hold only
single value as an element.
• A dictionary is a collection which is unordered,
changeable and indexed
• Values in a dictionary can be of any data type and
can be duplicated, whereas keys can’t be
repeated and must be immutable.
• Key value is provided in the dictionary to make it
more optimized.
Creating a Dictionary