April 2024
Beginner to intermediate
500 pages
24h 20m
English
A dictionary is a collection of pairs of key:objects. The objects, or values, are referenced by their keys. Python maintains the elements in the order in which they were added to the dictionary. You can create a Python dictionary as follows:
Table B.7 summarizes the Python dictionary methods.
Table B.7 Methods, Functions, and Operators Provided by Dictionaries in Python
| Name | Use | Explanation |
|---|---|---|
| keys | aDict.keys() | Returns a dict_keys object of keys in the dictionary. |
| values | aDict.values() | Returns a dict_values object of values in the dictionary. |
| items | aDict.items() | Returns a dict_items object of key–value ... |
Read now
Unlock full access