Beginning Swift 3 - Part 7: Loops | Ray Wenderlich

Learn about loops in Swift 3.

This is a companion discussion topic for the original entry at

I think we can use “where” keyword in loop.

for index in 1...10 where index % 2 == 0 { print(index) }

Yeah … you can certainly use the where statement. Since this was a course aimed for the absolute beginning, I avoided mentioning where, but thanks for you perspective. Cheers!

Hi @vegetarianzombie!

The PDF for this lesson is kind of corrupted, looks like this:

Could you please update it?


@vegetarianzombie : can we do it using while loop for Ub3r H4ck3r Challenge and i would like to see more challenges , is there a way to find it.

Minor edit for the challenge and solutions files. The first challenge contains the phrase "“print out the event numbers”. This should read “print out the even numbers”.