Dictionaries allow easy access to any value based on its key. The value can be used as a variable to implement various approaches and tasks.
Similar to a list, the content of all items in a dictionary is accessed using a for-loop, as was the case for lists (see Code Example 5.8) for details. Therefore, conceptually the major difference between dictionaries and lists is the possibility for the programmer to define the keys in dictionaries, while in lists they are defined automatically (0, 1, ). When pulling data from a particular key (or index for lists) or checking if a dictionary has a specific key (or an index) is computationally fast, these data structures allow performance gains compared to situations where one might usually just examine all values in a list and check if particular data exist.