All challenges

Tuesday, 6 October 2026

Past

Three rungs, one idea. Solving rung 1 counts. Climb as far as you can.

Even Or Odd

remainders + odd and even

Rung 1Daily goal5 points

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

InputOutput
4"even"
7"odd"
0"even"
-3"odd"

There are extra hidden tests, so make it work in general, not just for these.

Rung 2Bonus7 points

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

InputOutput
[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.

Rung 3Bonus10 points

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

InputOutput
[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.