Q. What does `dict.pop('key')` do?

  • (A) Removes and returns the value for 'key'
  • (B) Deletes the key only
  • (C) Removes all keys
  • (D) Raises an error always
πŸ’¬ Discuss
βœ… Correct Answer: (A) Removes and returns the value for 'key'
Explanation: `pop()` removes the specified key and returns its value.
Explanation by: Mr. Dubey
`pop()` removes the specified key and returns its value.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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