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

help

please help

Jake Adams
Jake Adams
1,608 Points

You're going to have to be more descriptive in both your title and the question. Please share what problem you're stuck on, how you need help, and any code snippets that you have already.

1 Answer

Hi Jeremy,

You need to create a for loop that uses the internal constant multiplier to store each successive value that you're looping over, 1 to 10.

What you want to do is multiply multiplier by 6 and append that value into the results array. At the end of the loop, results will hold [6, 12, 18, 24 ... etc ]. The append method of an array can do that for you.

Try with something like this:

var results: [Int] = []

for multiplier in 1...10{
    results.append(multiplier * 6)
}

I hope that helps,

Steve.