Dictionary Methods

 0    12 词汇卡    sir
下载mp3 打印 检查自己
 
问题 答案
Removes all the elements from the dictionary
开始学习
. clear()
Returns a copy of the dictionary.
开始学习
. copy()
Returns a dictionary with the specified keys and values
开始学习
dict. fromkeys(keys, value)
Returns the value of the specified key
开始学习
. get(key)
Returns a list containing the dictionary's keys
开始学习
. keys()
Returns a list containing the a tuple for each key value pair
开始学习
. items()
Removes the element with the specified key
开始学习
. pop(key)
Removes the last inserted key-value pair
开始学习
. popitem(keyname, defaultvalue)
Returns the value of the specified key. If the key does not exist: insert the key, with the specified value
开始学习
. setdefault(keyname, value)
Updates the dictionary with the specified key-value pairs
开始学习
. update(iterable)
Returns a list of all the values in the dictionary
开始学习
. values()
Checks whether a dictionary possesses the give key/index.
开始学习
. has_key()

您必须登录才能发表评论。