Quiz Complete, well Done!
Which of the following methods returns a list of all the keys in a dictionary?
What is the output of the following code?
dict = {'a': 1, 'b': 2, 'c': 3}
print(dict.get('d', 'Not found'))
What does the method 'values()' do in Python?
What does the method 'keys()' do in Python?
Which of the following is NOT a valid key type for a dictionary?
What method do you use to remove a key-value pair from a dictionary?
What happens if you try to add a key-value pair to a dictionary using an existing key?
What happens if you try to access a key that does not exist in a dictionary?
What is the time complexity of accessing an element in a dictionary?
What happens if you try to access a key that does not exist in a dictionary using the 'get' method?
What does the method 'keys()' do in Python?
What does the method 'items()' do in Python?
How can you remove a key-value pair from a dictionary?
Which of the following is NOT a valid key type for a Python dictionary?
What happens if you try to access a key that doesn't exist in a dictionary?