Course of Raku / Advanced / More about built-in types / Sequences / Exercises / Odd numbers
Solution: Odd numbers
Here is a possible solution to the task.
Code
say 1, 3 ... 19;🦋 You can find the source code in the file odd-numbers.raku.
Output
(1 3 5 7 9 11 13 15 17 19)Comments
The two starting values
1, 3set the step to two, so the sequence counts up by two.The sequence stops as soon as it reaches the endpoint
19.
Course navigation
← Odd numbers | Powers of two →