Thursday, 1 October 2026
PastThree rungs, one idea. Solving rung 1 counts. Climb as far as you can.
Fizz Then Buzz
if/else + number rules
One number, one answer
Write a function called say
Return "fizz" if the number divides exactly by 3, "buzz" if it divides exactly by 5, and "fizzbuzz" if it divides by both. Any other number comes back as a string of itself, so 7 returns "7".
Examples
| Input | Output |
|---|---|
| 3 | "fizz" |
| 5 | "buzz" |
| 15 | "fizzbuzz" |
| 7 | "7" |
There are extra hidden tests, so make it work in general, not just for these.
All the way up
Write a function called say_all
Return a list of the answers for every number from 1 up to n, using the same three rules. If n is 0 or less there are no numbers to answer, so return an empty list.
Examples
| Input | Output |
|---|---|
| 5 | ["1", "2", "fizz", "4", "buzz"] |
| 1 | ["1"] |
| 0 | [] |
| -2 | [] |
There are extra hidden tests, so make it work in general, not just for these.
Lucky beats everything
Write a function called say_lucky
One number at a time again, with one new rule that wins over the others: if the number has a 7 anywhere in its digits the answer is "lucky", even when it also divides by 3 or 5. n is always 0 or more. Everything else works exactly as in rung 1.
Examples
| Input | Output |
|---|---|
| 7 | "lucky" |
| 21 | "fizz" |
| 10 | "buzz" |
| 4 | "4" |
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.