Question 1
Which method can you use to remove a key-value pair from a dictionary and return its value?
Question 2
What is the purpose of the clear() method in a dictionary?
Question 3
What does the values() method return in a dictionary?
Question 4
What does the len() function return when applied to a dictionary?
Question 5
Which built-in function can be used to create a new dictionary in python?
Question 6
Which of the following methods can be used to add a key-value pair to an existing dictionary?
Question 7
Which method can you use to retrieve a list of all key-value pairs in a dictionary as tuples?
Question 8
Which method can be used to create a shallow copy of a dictionary?
Question 9
Which method can be used to retrieve a list of all keys in a dictionary?
Question 10
What is the result of the following code?
{apple:3,banana:2,cherry:5}
my_dict.setdefault(pear,0)