← Back to challenges

"InnoKod" Challenge

PythonHardalgorithmsmath

Instructions

Create a function that returns the list of numbers from a given range. But for multiples of three, return “Inno” instead of the number and for the multiples of five, return “Kod”. For numbers which are multiples of both three and five, return “InnoKod”.

Examples

eda_bit(0, 10) ➞ ["InnoKod", 1, 2, "Inno", 4, "Kod", "Inno", 7, 8, "Inno", "Kod" ]

eda_bit(14, 20) ➞ [14,  "InnoKod", 16, 17,  "Inno", 19, "Kod" ]

eda_bit(99, 106) ➞ ["Inno", "Kod", 101, "Inno", 103, 104, "InnoKod", 106 ]

Notes

In case the number 0 happens to be in the range, return "InnoKod" as well.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Count Palindrome Numbers in a Range