Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
Give this quiz to my class
Q 1/9
Score 0
Which of the following methods would you use to add a new key-value pair to a Python dictionary?
30
dict.append(key, value)
dict.insert(key, value)
dict.add(key, value)
dict[key] = value
Q 2/9
Score 0
Which built-in method would you use to remove a key-value pair from a Python dictionary?
30
dict.pop(key)
dict.delete(key)
del dict[key]
dict.remove(key)
9 questions
Q.
Which of the following methods would you use to add a new key-value pair to a Python dictionary?
1
30 sec
Q.
Which built-in method would you use to remove a key-value pair from a Python dictionary?
2
30 sec
Q.
What method can be used to obtain a list of all keys in a Python dictionary?
3
30 sec
Q.
Which built-in function would you use to retrieve the value of a specific key in a Python dictionary, returning a default value if the key does not exist?
4
30 sec
Q.
What method would you use to obtain a list of all values in a Python dictionary?
5
30 sec
Q.
Which built-in method would you use to remove and return a value from a dictionary using its key?
6
30 sec
Q.
Which method would you use to clear all items from a Python dictionary?
7
30 sec
Q.
What method would you use to merge two dictionaries in Python?
8
30 sec
Q.
Which method allows you to create a copy of a dictionary in Python?