Q.

If a is a dictionary with some key-value pairs, what does a.popitem() do?

A. removes an arbitrary element
B. removes all the key-value pairs
C. removes the key-value pair for the key given as an argument
D. invalid method for dictionary
Answer» A. removes an arbitrary element
Explanation: the method popitem() removes a random key-value pair.
688
0
Do you find this helpful?
1

Discussion

No comments yet