A

Admin • 833K Points
Coach

Q. How do you check if a key exists in a dictionary?

  • (A) if key in dict
  • (B) if dict.has(key)
  • (C) if dict.find(key)
  • (D) if key.exists(dict)
  • Correct Answer - Option(A)
  • Views: 24
  • Filed under category Python
  • Hashtags:

Explanation by: Admin

Use the 'in' keyword to check for key existence.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.