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 Looping Over Ranges

The answer for the second objective(if you needs it)

var results: [Int] = []
 for multiplier in results { 
print("the multiple is \(multiplier) times 6, which equal to \(multiplier*6)" 

results.append(multiplier*6)

}
Christian A. Castro
Christian A. Castro
30,501 Points

Hi !! faisal rustom I think you miss something on your answer for the second objective, your code should look like this

var results: [Int] = []
for multiplier 1...10 
{ print("the multiple is \(multiplier) times 6, which is equal to \(multiplier*6)")
results.append(multiplier*6)
}

you just miss the range on the for loop!! thanks, Amaury.

1 Answer

Amaury C. Castro Rivera

Hi could you please explain why thats the answer I struggled on the 2nd objective and have used this to get past the challenge but would like to actually understand it

Thank you Alia