Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Swift 2.0 Collections and Control Flow Control Flow With Loops For In Loops

Edwin Brown
PLUS
Edwin Brown
Courses Plus Student 1,787 Points

I do not understanding what is being ask for the question.

No additional question

loops.swift
// Enter your code below
var results: [Int] = [1,2,3,4,5,6]
let multiplier: Int 
for multiplier  in results {  print(results[1...10]  )
}
Digvijay Jaiswal
Digvijay Jaiswal
5,565 Points

What are you trying to achieve here?

2 Answers

Arvin San Miguel
PLUS
Arvin San Miguel
Courses Plus Student 3,160 Points

Hi Edwin, It's asking you to put the results of the multiplication table of 6 in the results Array.

// Enter your code below

var results: [Int] = []

for multiplier in 1...10 {
var result: Int = multiplier * 6 // I used this variable in order to return the value and append it to the Results array. print("6 * (multiplier)" + " = (multiplier*6)") results.append(result) }

Try this code. Hope this will help you.

Digvijay Jaiswal
Digvijay Jaiswal
5,565 Points

Arvin San Miguel your answer is correct. I am just putting it in readable format.

var results: [Int] = []

for multiplier in 1...10 {
var result: Int = multiplier * 6 // I used this variable in order to return the value and append it to the Results array. 
print("6 * (multiplier)" + " = (multiplier*6)") 
results.append(result) }