Dictionary Methods

 0    12 fiche    sir
laste ned mp3 Skriv ut spille sjekk deg selv
 
spørsmålet svaret
Removes all the elements from the dictionary
begynn å lære
. clear()
Returns a copy of the dictionary.
begynn å lære
. copy()
Returns a dictionary with the specified keys and values
begynn å lære
dict. fromkeys(keys, value)
Returns the value of the specified key
begynn å lære
. get(key)
Returns a list containing the dictionary's keys
begynn å lære
. keys()
Returns a list containing the a tuple for each key value pair
begynn å lære
. items()
Removes the element with the specified key
begynn å lære
. pop(key)
Removes the last inserted key-value pair
begynn å lære
. popitem(keyname, defaultvalue)
Returns the value of the specified key. If the key does not exist: insert the key, with the specified value
begynn å lære
. setdefault(keyname, value)
Updates the dictionary with the specified key-value pairs
begynn å lære
. update(iterable)
Returns a list of all the values in the dictionary
begynn å lære
. values()
Checks whether a dictionary possesses the give key/index.
begynn å lære
. has_key()

Du må logge inn for å legge inn en kommentar.