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
πŸ’¬ Discuss
βœ… Correct Answer: (A) removes an arbitrary element
Explanation: the method popitem() removes a random key-value pair.

Explanation by: Mr. Dubey
the method popitem() removes a random key-value pair.

πŸ’¬ Discussion

πŸ“Š Question Analytics

πŸ‘οΈ
494
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
89%
Success Rate