Dictionary Methods

 0    12 flashcards    sir
tải về mp3 In chơi tự kiểm tra
 
câu hỏi câu trả lời
Removes all the elements from the dictionary
bắt đầu học
. clear()
Returns a copy of the dictionary.
bắt đầu học
. copy()
Returns a dictionary with the specified keys and values
bắt đầu học
dict. fromkeys(keys, value)
Returns the value of the specified key
bắt đầu học
. get(key)
Returns a list containing the dictionary's keys
bắt đầu học
. keys()
Returns a list containing the a tuple for each key value pair
bắt đầu học
. items()
Removes the element with the specified key
bắt đầu học
. pop(key)
Removes the last inserted key-value pair
bắt đầu học
. popitem(keyname, defaultvalue)
Returns the value of the specified key. If the key does not exist: insert the key, with the specified value
bắt đầu học
. setdefault(keyname, value)
Updates the dictionary with the specified key-value pairs
bắt đầu học
. update(iterable)
Returns a list of all the values in the dictionary
bắt đầu học
. values()
Checks whether a dictionary possesses the give key/index.
bắt đầu học
. has_key()

Bạn phải đăng nhập để đăng bình luận.