Question:

What output will be produced by the code below?

let numbers = Array(1..<10)
print(numbers.count)

Correct answer: 9.

Explanation: This array constructor creates values based on the range from 1 up to (but not including 10). This means it will include the numbers 1, 2, 3, 4, 5, 6, 7, 8, and 9, so the count will be 9.


Keywords:

© 2017 QuizBucket.org