Programming in Swift: Fundamentals

Oct 19 2021 · Swift 5.5, iOS 15, Xcode 13

Part 3: Control Flow

21. Challenge: For Loops

Episode complete

Play next episode

About this episode

Leave a rating/review

See forum comments
Cinema mode Mark complete Download course materials
Previous episode: 20. For Loops Next episode: 22. Iterating Collections

Get immediate access to this and 4,000+ other videos and books.

Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and 4,000+ professional videos in a single subscription, it's simply the best investment you can make in your development career.

Learn more Already a subscriber? Sign in.

Notes: 21. Challenge: For Loops

Update Notes: The student materials have been reviewed and are updated as of October 2021.

Heads up... You've reached locked video content where the transcript will be shown as obfuscated text.

It’s time for your next challenge! You can find the challenge in the “05 - Challenge - For Loop” page of the playground you’ve been using, or you can download a new one from the resources for this video. Open it up, and try solving the challenge questions on your own, then keep watching to compare your work to mine. Good luck!

for i in 1...100 {

for i in 1...100 where i % 5 == 0 {
let rangeStart = 10
for rangeValue in rangeStart
for rangeValue in rangeStart..<rangeStart + 3 {
    print("Range value is \(rangeValue)")
var randomCount = Int.random(in: 1...5)
for _
for _ in 1...randomCount {