Swift Guide Tour Playground에 있는 것인데요.
아래와 같은 코드에서 Experiment로 “Replace the _ with a variable name, and keep track of which kind of number was the largest.”
라고 하는데, _ 을 어떻게 바꿔야 하나요? “Prime”이러면 에러나고…
================================
let interestingNumbers = [
“Prime”: [2, 3, 5, 7, 11, 13],
“Fibonacci”: [1, 1, 2, 3, 5, 8],
“Square”: [1, 4, 9, 16, 25],
]
var largest = 0
for (_, numbers) in interestingNumbers {
for number in numbers {
if number > largest {
largest = number
}
}
}
print(largest)