Table of Contents » Reference Materials : Dictionary Methods
Dictionary Methods
Dictionary Method | Description |
---|---|
clear() |
Removes all the elements from the specified dictionary. General Form:
|
copy() |
Returns a copy of the specified dictionary. General Form:
|
fromkeys() |
Returns a dictionary with the specified keys and data values. General Form:
|
get() |
Returns the value associated with the specified key. General Form:
|
items() |
Returns a list containing a tuple for each key value pair in the specified dictionary. General Form:
|
keys() |
Returns a list of the specified dictionary's keys. General Form:
|
pop() |
Removes the value based on the specified key. General Form:
|
popitem() |
Removes the last inserted key-value pair from the specified dictionary. General Form:
|
setdefault() |
Returns the value associated with the specified key. If the specified key does not exist, it will be inserted with the specified (optional) value. General Form:
|
update() |
Updates the specified dictionary with the specified key-value pairs. General Form:
|
values() |
Returns a list of all values in the specified dictionary. General Form:
|