Skip to content

Commit a87f704

Browse files
committedDec 19, 2023
Add Task headers
1 parent 688ea6b commit a87f704

File tree

8 files changed

+8
-0
lines changed

8 files changed

+8
-0
lines changed
 

‎Loops/Break keyword/task.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ escape the loop.
77

88
For more structured and detailed information, you can refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/6302#break).
99

10+
### Task
1011
Write a condition to exit the loop on its third iteration after evaluating if `animal`
1112
is equal to `elephant`. Use the `break` statement. The `zoo` list in the end should contain
1213
only `lion` and `tiger` (because you `pop` all the other ones in the loop).

‎Loops/Continue keyword/task.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ the `else` clause is executed if it is present.
77

88
For more structured and detailed information, you can refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/6302#continue).
99

10+
### Task
1011
Print only the odd numbers `1, 3, 5, 7, 9`.
1112

1213
<div class='hint'>Use the <code>%</code> operator to check if <code>x</code> is even.</div>

‎Loops/Else with loops/task.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ is completed (unless there was a `break` in there somewhere).
3636

3737
For more structured and detailed information, you can refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/6302).
3838

39+
### Task
3940
In the code editor, add two lines of code to the second loop to make sure the loop only prints
4041
numbers 1 and 2 and never prints the phrase `"for loop is done"`.
4142

‎Loops/For loop/task.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ You can read more about the `for` statement on <a href="https://docs.python.org/
1010

1111
For more structured and detailed information, you can also refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/6065).
1212

13+
### Task
1314
Print each prime number from the `primes` list using the `for` loop. A prime
1415
number is a natural number greater than `1` that has no positive divisors
1516
other than `1` and itself.

‎Loops/List Comprehension/task.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ List comprehensions are also more efficient computationally than a `for` loop.
3030

3131
For more structured and detailed information, you can refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/6315).
3232

33+
### Task
3334
In the code editor, use list comprehension to build `my_efficient_list` from the elements of `my_inefficient_list`
3435
by adding $10$ to each of them. For example, the first element of `my_inefficient_list` is $1 + 10 = 11$,
3536
so the first element of `my_efficient_list` should be $11 + 10 = 21$, and so on.

‎Loops/Loop over a string/task.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
As we discussed earlier, strings in Python are in many ways similar to lists.
44
You can iterate over a string just like you would iterate over a list.
55

6+
### Task
67
Use a loop to count how many characters `hello_world` contains. Store
78
this number in the variable `length`.
89

‎Loops/Nested for Loop/task.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ For example, a [`while` loop](course://Loops/While loop) (see further) can be ne
3131

3232
For more structured and detailed information, you can refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/6065#nested-loop).
3333

34+
### Task
3435
You are given a tic-tac-toe board of 3x3, your task is to print every position. Coordinates along each side
3536
are stored in the list `coordinates`. The output should be:
3637
```text

‎Loops/While loop/task.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ code for as long as the condition is `True`. If the expression is `False`, the
66

77
For more structured and detailed information, you can refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/5940).
88

9+
### Task
910
Print all squares from `1` to `9` `(1, 4, ... , 81)`. Use the `number` variable in a
1011
`while` loop.
1112

0 commit comments

Comments
 (0)