Dictionary Methods

 0    12 fiche    sir
ladda ner mp3 skriva ut spela Kontrollera dig själv
 
Fråga Svar
Removes all the elements from the dictionary
börja lära sig
. clear()
Returns a copy of the dictionary.
börja lära sig
. copy()
Returns a dictionary with the specified keys and values
börja lära sig
dict. fromkeys(keys, value)
Returns the value of the specified key
börja lära sig
. get(key)
Returns a list containing the dictionary's keys
börja lära sig
. keys()
Returns a list containing the a tuple for each key value pair
börja lära sig
. items()
Removes the element with the specified key
börja lära sig
. pop(key)
Removes the last inserted key-value pair
börja lära sig
. popitem(keyname, defaultvalue)
Returns the value of the specified key. If the key does not exist: insert the key, with the specified value
börja lära sig
. setdefault(keyname, value)
Updates the dictionary with the specified key-value pairs
börja lära sig
. update(iterable)
Returns a list of all the values in the dictionary
börja lära sig
. values()
Checks whether a dictionary possesses the give key/index.
börja lära sig
. has_key()

Du måste vara inloggad för att skriva en kommentar.