Quiz Complete, well Done!
Hash Table
Dictionary Methods
Immutable
What happens if you try to access a key that does not exist in a dictionary?
What is the output of the following code?
dict = {'a': 1, 'b': 2, 'c': 3}
for key in dict:
print(key)
Dictionaries in Python are
.
Value
A
is a collection of key-value pairs.
If you try to access a key that does not exist in a dictionary, it will result in a(n)
.
What is the time complexity of accessing an element in a dictionary?
What is a dictionary in Python?
What does the method 'keys()' do in Python?
Items
|
|
|
|
|
|
|
|
|
|
The method used to remove a key-value pair from a dictionary is
().
The method used to add a new key-value pair to a dictionary is
().
Values
How can you remove a key-value pair from a dictionary?
What is a dictionary in Python?
What is the output of the following code?
dict = {'a': 1, 'b': 2, 'c': 3}
print(len(dict))