Dictionary Method
|
Description
|
clear()
|
Removes all the elements from the specified dictionary. General Form:
dictionary_var.clear()
|
copy()
|
Returns a copy of the specified dictionary. General Form:
dictionary_var.copy()
|
fromkeys()
|
Returns a dictionary with the specified keys and data values. General Form:
dictionary_var.fromkeys(keys[, values])
|
get()
|
Returns the value associated with the specified key. General Form:
dictionary_var.get(keyname[, value])
|
items()
|
Returns a list containing a tuple for each key value pair in the specified dictionary. General Form:
dictionary_var.items()
|
keys()
|
Returns a list of the specified dictionary's keys. General Form:
dictionary_var.keys()
|
pop()
|
Removes the value based on the specified key. General Form:
dictionary_var.pop(keyname[, value])
|
popitem()
|
Removes the last inserted key-value pair from the specified dictionary. General Form:
dictionary_var.popitem()
|
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:
dictionary_var.setdefault(key[, value])
|
update()
|
Updates the specified dictionary with the specified key-value pairs. General Form:
dictionary_var.update(iterable)
|
values()
|
Returns a list of all values in the specified dictionary. General Form:
dictionary_var.values()
|