True/False 1. Swift arrays are homogeneous and must contain elements of the same
ID: 3909437 • Letter: T
Question
True/False
1. Swift arrays are homogeneous and must contain elements of the same type. T / F
2. There are three basic collection types in Swift: Arrays, Dictionaries, and Sets. T / F
3. A tuple is a way to return multiple values simultaneously from a function. T / F
-----------------------------
In the example below, what is the type of matchingLines and what is its value?
func search(lines: [String], for keywords: String...) -> [String]? {
// function implementation
}
let lines = ["It's a trap!", "Luke I am your father", "The force is strong with this one"]
let matchingLines = search(lines: lines, for: "trap", "admiral")
Type: _____________ Value: ______________
Explanation / Answer
1. True
2. True
3. True
Type: String Value:
Optional(["It's a trap!", "Luke I am your father", "The force is strong with th
is one"])
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.