Quiz Complete, well Done!
What happens if you try to access a key that doesn't exist in a dictionary?
What does the method 'keys()' do in Python?
What is a dictionary in Python?
What is the output of the following code?
dict = {'a': 1, 'b': 2, 'c': 3}
print(dict['b'])
What is the output of the following code?
dict = {'a': 1, 'b': 2, 'c': 3}
print(len(dict))
How can you access the value associated with a specific key in a dictionary?
What does the method 'values()' do in Python?
What happens if you try to access a key that does not exist in a dictionary?
What does the method 'items()' do in Python?
What is the output of the following code?
dict = {'a': 1, 'b': 2, 'c': 3}
for key in dict:
print(key)
How do you add a new key-value pair to an existing dictionary?
Which of the following methods returns a list of all the keys in a dictionary?
What is a dictionary in Python?
How do you add a new key-value pair to an existing dictionary?
Which of the following is NOT a valid key type for a dictionary?