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

Seth Baker
Seth Baker
1,224 Points

I can't tell what I'm doing wrong

I dunno. I'll put the line into Xcode and it gives me the desired response (I think, maybe I just don't understand the question)

loops.swift
// Enter your code below
var results: [Int] = []


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

2 Answers

You've misunderstood the question. You shouldn't be printing out the desired result. Instead you should be appending the multiples of 6 to the array provided to you.

Seth Baker
Seth Baker
1,224 Points

ohhhhhhhh great! thanks i figured it out. i knew it was something stupid like that.

Thank you soooo much!