A

Admin • 832.27K Points
Coach

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

  • (A) Error
  • (B) None
  • (C) 'default'
  • (D) 0
  • Correct Answer - Option(C)
  • Views: 18
  • Filed under category Python
  • Hashtags:

Explanation by: Admin

`get()` returns the provided default value if the key does not exist.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.