Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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

Stuck at first task of Collections and Control Flow

I believe I understand what they are asking from me for the first part, but I m not sure what exactly I have to equal the multiplier to.

loops.swift
var results: [Int] = [6]


for number in 1...10{
    print("\(number) times 6 is equal to \(number * 6)")
}

let mutliplier = 1...10

3 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

I think maybe you've gotten some things mixed up in their instructions. I posted the solution to this challenge along with an explanation here: https://teamtreehouse.com/community/how-do-i-add-the-for-in-loop-to-the-variable-results

Take a look and see if it clarifies what they're asking you to do and how to solve it. Hope it helps!

Thanks for the answer, in that case using print simply means that we "print" the values in our debug window for us to see?

Jennifer Nordell
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Right, it'll print to the console. And in challenges it's important to not do things they don't ask you to do. I've seen perfectly good code break a challenge because it was printed instead of returned or vice versa. They are super picky! :)

Ah ok thanks a lot!