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 Collections and Control Flow Control Flow With Loops For In Loops

Bastian Petersson
Bastian Petersson
9,164 Points

treehouse Swift 3 Collections and Control Flow Challenge Task 2 of 2

I don't know what to white in the array. I have tried everything! Anyone knows what I am doing wrong?

loops.swift
// Enter your code below
for multiplier in 1...10{
print (multiplier * 6)
}

var results: [Int] = [multiplier]

1 Answer

Hi there,

Leave the results array as it is; empty and above the loop; it is the top line of code.

Inside the loop, you're not printing the output, you need to append the result of multiplier * 6 to the array. Use results.append(multiplier * 6).

That should do it!

Steve.

No problem! You'd done the hard bit! :+1: :smile: