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 https://www.raywenderlich.com/4095-beginning-swift-3/lessons/7

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?

Thanks!

@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.
Thanks

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”.