Quiz Complete, well Done!
Dictionary Methods
Nested Dictionary
|
|
|
|
|
|
|
|
|
|
The function used to check if a key is present in a dictionary is
().
Which of the following is a valid way to create an empty dictionary in Python?
The method used to get the value of a key in a dictionary without raising an error is
().
If you try to access a key that does not exist in a dictionary, it will result in a(n)
.
Copy
What is the syntax for creating a dictionary in Python?
The method used to add a new key-value pair to a dictionary is
().
If you try to access a key that does not exist in a dictionary, it will result in a(n)
.
Update
Hash Table
Which of the following methods returns a list of all the keys in a dictionary?
A Python dictionary cannot have two keys with the
name.
Values
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?
What does the method 'items()' do in Python?
A Python dictionary cannot have two keys with the
name.