Skip to content
Merged
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
31 changes: 27 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1519,6 +1519,7 @@ In this step, let's look at a few exercises.
3. Print the first 10 even numbers in reverse
4. Print the squares of the first 10 numbers
5. Print the squares of the first 10 numbers, in reverse
6. Print the squares of the even numbers

#### Solution 1

Expand Down Expand Up @@ -1565,11 +1566,32 @@ Usually these step value is positive, but we need to go backwards from ```10```.

#### Solution 3

Next, we would want to print the squares of the first ```10``` numbers.
Now, let's print the first ```10``` even numbers in reverse.

```py
>>> for i in range (20,0,-2):
... print(i)
...
20
18
16
14
12
10
8
6
4
2

```

#### Solution 4

Next, we would want to print the squares of the first 10 numbers.

```py
>>> for i in range (1,11):
... print(i * i)
... print(i * i)
...
1
4
Expand All @@ -1584,7 +1606,7 @@ Next, we would want to print the squares of the first ```10``` numbers.

```

#### Solution 4
#### Solution 5

Let's print the squares in the reverse order.

Expand All @@ -1605,7 +1627,8 @@ Let's print the squares in the reverse order.

```

#### Solution 5

#### Solution 6

Print the squares of the even numbers. How to do that?

Expand Down