Quiz Complete, well Done!
Mutable
A Python dictionary cannot have two keys with the
name.
Which of the following is NOT a valid key type for a Python dictionary?
The method used to add a new key-value pair to a dictionary is
().
Pop
Dictionary Methods
Nested Dictionary
The function used to check if a key is present in a dictionary is
().
The method used to remove a key-value pair from a dictionary is
().
Update
What is the output of the following code?
dict = {'a': 1, 'b': 2, 'c': 3}
print(len(dict))
What does the method 'items()' do in Python?
How can you remove a key-value pair from a dictionary?
Which of the following methods returns a list of all the keys in a dictionary?
Which of the following is a valid way to create an empty dictionary in Python?
What is the time complexity of accessing an element in a dictionary?
Dictionaries in Python are
.
A key in a Python dictionary must be of a(n)
type.
The method used to add a new key-value pair to a dictionary is
().