Quiz Complete, well Done!
Update
What does the method 'keys()' do in Python?
What happens if you try to access a key that doesn't exist in a dictionary?
If you try to access a key that does not exist in a dictionary, it will result in a(n)
.
Dictionary Comprehension
Immutable
How do you add a new key-value pair to an existing dictionary?
A Python dictionary cannot have two keys with the
name.
What happens if you try to access a key that does not exist in a dictionary using the 'get' method?
Nested Dictionary
What is the output of the following code?
dict = {'a': 1, 'b': 2, 'c': 3}
print(len(dict))
In Python, dictionaries are denoted by enclosing a comma-separated pair of curly braces with
within.
Which of the following methods returns a list of all the keys in a dictionary?
What does the method 'items()' do in Python?
What is a dictionary in Python?
Value
Items
What does the method 'keys()' do in Python?
What happens if you try to access a key that does not exist in a dictionary?
If you try to access a key that does not exist in a dictionary, it will result in a(n)
.