Quiz Complete, well Done!
Dictionaries in Python are
.
Dictionary
A
is a collection of key-value pairs.
A key in a Python dictionary must be of a(n)
type.
Value
A key in a Python dictionary must be of a(n)
type.
The function used to check if a key is present in a dictionary is
().
What is the output of the following code?
dict = {'a': 1, 'b': 2, 'c': 3}
print(dict['b'])
Copy
Immutable
Get
Keys
Which of the following methods returns a list of all the keys in a dictionary?
What happens if you try to access a key that doesn't exist in a dictionary?
In Python, dictionaries are denoted by enclosing a comma-separated pair of curly braces with
within.
How can you remove a key-value pair from a dictionary?
The method used to remove a key-value pair from a dictionary is
().
The method used to remove a key-value pair from a dictionary is
().
Dictionaries in Python are
.