A

Admin • 670.22K Points
Coach

Q. What will the following code print?

Code:
let list = ["a", "b", "c"]
if list.contains("b") {
print("Found") }
  • (A) true
  • (B) Found
  • (C) false
  • (D) Error
  • Correct Answer - Option(B)
  • Views: 1
  • Filed under category Swift (iOs)
  • Hashtags:

Explanation by: Admin
The array contains 'b', so the condition is true and 'Found' is printed.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.