Q. What does `dict.get('key', 'default')` return if the key is not found?

  • (A) Error
  • (B) None
  • (C) 'default'
  • (D) 0
πŸ’¬ Discuss
βœ… Correct Answer: (C) 'default'
Explanation: `get()` returns the provided default value if the key does not exist.
Explanation by: Mr. Dubey
`get()` returns the provided default value if the key does not exist.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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