Removes all items from a dictionary, making it empty
Reference
Dictionary Methods
Methods available on Python dict objects.
- dict.clear()
- dict.copy()
Returns a shallow copy of a dictionary, creating a new dictionary with the same key-value pairs
- dict.fromkeys()
Creates a new dictionary with keys from an iterable and values set to a specified value
- dict.get()
Returns the value for a key, or a default value if the key is not found
- dict.items()
Returns a view object that displays a list of dictionary's key-value tuple pairs
- dict.keys()
Returns a view object that displays a list of all keys in a dictionary
- dict.pop()
Removes and returns the value for a specified key, optionally with a default value if the key does not exist
- dict.popitem()
Removes and returns the last key-value pair from a dictionary as a tuple
- dict.setdefault()
Returns the value for a key, inserting a default if the key does not exist
- dict.update()
Updates a dictionary with key-value pairs from another dictionary or iterable
- dict.values()
Returns a view object that displays a list of all values in a dictionary