Forums
Learn
Careers
Store
About
SUBSCRIBE
UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>
Question 1/6: Which of these lines make an array, dictionary, set, or tuple?
Hint: Make sure the type annotations match what's placed inside. Click to show.
Option 1:
var fibonacci = (1, 1, 2, 3, 5, 8)
This creates a tuple.
Option 2:
var repeatCount = [String: Int]
This is invalid Swift – it needs parentheses after [String: Int].
[String: Int]
Correct!
Oops – that's not correct.
Return to Review Menu
You are not logged in
Link copied to your pasteboard.