Tuesday, 6 October 2026
PastThree rungs, one idea. Solving rung 1 counts. Climb as far as you can.
Even Or Odd
remainders + odd and even
Which one is it
Write a function called even_or_odd
Return "even" if the number divides exactly by 2 and "odd" if it does not. Zero counts as even, and negative numbers follow the same rule, so -3 is "odd".
Examples
| Input | Output |
|---|---|
| 4 | "even" |
| 7 | "odd" |
| 0 | "even" |
| -3 | "odd" |
There are extra hidden tests, so make it work in general, not just for these.
Find the first odd one
Write a function called first_odd
Go through the list from the start and return the first odd number you find. If every number is even, and also when the list is empty, return None.
Examples
| Input | Output |
|---|---|
| [2, 4, 5, 6] | 5 |
| [2, 4] | None |
| [] | None |
| [-3, 2] | -3 |
There are extra hidden tests, so make it work in general, not just for these.
Taking turns
Write a function called alternates
Return True when the numbers take turns between even and odd all the way along, so [1, 2, 3] is True but [1, 3, 2] is False. It makes no difference whether the list starts on an even or an odd number. A list with nothing in it, or only one number, counts as taking turns, so return True for those.
Examples
| Input | Output |
|---|---|
| [1, 2, 3] | True |
| [1, 3, 2] | False |
| [] | True |
| [4] | True |
There are extra hidden tests, so make it work in general, not just for these.
Finish Rung 1 and today counts. Rungs 2 and 3 are there if you want to push further.