Dictionaries
Look into the key features of the dictionary data structure.
We'll cover the following
Structure
A dictionary has a slightly more complex structure than a list or tuple. When we think of a dictionary, we imagine a vast book containing words and their meanings. In simpler terms, information is stored in pairs of words and meanings. Python’s dictionary data structure follows the same structure. A dictionary stores key-value pairs, where each unique key is an index that holds the value associated with it. Dictionaries are unordered because the entries are not stored in a linear structure. In Python, we must put the dictionary’s content inside curly brackets, {}
:
Get hands-on with 1400+ tech skills courses.