A

Admin • 832.27K Points
Coach

Q. Which of the following defines a dictionary in Swift?

  • (A) let dict = ["key": "value"]
  • (B) let dict = ("key", "value")
  • (C) let dict = {key: value}
  • (D) let dict = ["key" -> "value"]
  • Correct Answer - Option(A)
  • Views: 21
  • Filed under category Swift (iOs)
  • Hashtags:

Explanation by: Admin

This is the correct syntax to create a dictionary with a key-value pair.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.