Quiz Complete, well Done!
Get
Items
Immutable
Length
The method used to add a new key-value pair to a dictionary is
().
The method used to get the value of a key in a dictionary without raising an error is
().
A
is a collection of key-value pairs.
What does the method 'items()' do in Python?
Hash Table
Which of the following is NOT a valid key type for a dictionary?
What does the method 'keys()' do in Python?
What is the output of the following code?
dict = {'a': 1, 'b': 2, 'c': 3}
print('a' in dict)
Which of the following is a valid way to create an empty dictionary in Python?
A key in a Python dictionary must be of a(n)
type.
A
is a collection of key-value pairs.
Value
What does the method 'values()' do in Python?
In Python, dictionaries are denoted by enclosing a comma-separated pair of curly braces with
within.
|
|
|
|
|
|
|
|
|
|
What method do you use to remove a key-value pair from a dictionary?