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 Basics (retired) Control Flow For-In Loop

dont uderstand

xsdw

for_loops.swift
for-in = 1 * 7
for-in = 2 * 7
for-in =

Have a look at the Control Flow section of the developer docs. For In loops are explained in detail there, basically the first example is the solution to this assignment. I also recommend watching the videos again!

1 Answer

var numbers = 1...7

for number in numbers {
    println("\(number) * 7)
}

For-in loops keep looping until the value is false.

Your output should be.. 1 * 7 etc

Take care, this has to be

for number in numbers {

Thanks Martin, I updated it

Thanks Martin, I updated it

Sure thing :)