Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions concepts/for-loops/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ Looping is a fundamental concept in programming that allows you to execute a blo
In Swift, there are two types of loops: [`for-in` loops][for-loops] and `while` loops.
In this chapter, you'll learn about `for-in` loops.

For loops allows you to iterate over a sequence of values, taking each element in turn, and binding it to a variable of your choosing.
For loops allows you to iterate over a sequence of values, taking each element in turn, binding it to a variable of your choosing.
Swift allows you to iterate over a variety of sequences, such as ranges, arrays, and strings (and more types which will be covered later).
When every element of the sequence has been iterated over, the loop exits.

For loops are declared by using the `for` keyword, followed by a variable name, the `in` keyword, and a sequence of values to iterate over.
The variable given in the `for-in` loop is inmutable, meaning you can't change its value inside the loop.
The variable given in the `for-in` loop is immutable, meaning you can't change its value inside the loop.
Here's an example of a `for-in` loop that iterates over an array of numbers:

```swift
Expand Down
2 changes: 1 addition & 1 deletion concepts/for-loops/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Swift allows you to iterate over a variety of sequences, such as ranges, arrays,
When every element of the sequence has been iterated over, the loop exits.

For loops are declared by using the `for` keyword, followed by a variable name, the `in` keyword, and a sequence of values to iterate over.
The variable given in the `for-in` loop is inmutable, meaning you can't change its value inside the loop.
The variable given in the `for-in` loop is immutable, meaning you can't change its value inside the loop.
Here's an example of a `for-in` loop that iterates over an array of numbers:

```swift
Expand Down
4 changes: 2 additions & 2 deletions exercises/concept/bird-watcher/.docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Swift allows you to iterate over a variety of sequences, such as ranges, arrays,
When every element of the sequence has been iterated over, the loop exits.

For loops are declared by using the `for` keyword, followed by a variable name, the `in` keyword, and a sequence of values to iterate over.
The variable given in the `for-in` loop is inmutable, meaning you can't change its value inside the loop.
The variable given in the `for-in` loop is immutable, meaning you can't change its value inside the loop.
Here's an example of a `for-in` loop that iterates over an array of numbers:

```swift
Expand Down Expand Up @@ -46,7 +46,7 @@ number + 1

You can also iterate over a range of numbers using a `for-in` loop.
This allows you to execute a block of code a specific number of times, for example, the range `1...5` will iterate over the numbers 1, 2, 3, 4, and 5, so the loop will execute 5 times.
Sometimes you might want to iterate over indexes, in a datastructure like an array, then you can use a `0..<array.count` range.
Sometimes you might want to iterate over indexes, in a data-structure like an array, then you can use a `0..<array.count` range.

```swift
let numbers = [3, 10, 7, 11]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ func birdsInWeek(_ birdsPerDay: [Int], weekNumber: Int) -> Int {
}

func fixBirdCountLog(_ birdsPerDay: [Int]) -> [Int] {
fatalError("Please implement the birdsInWeek(_:) function")
fatalError("Please implement the fixBirdCountLog(_:) function")
}