Course of Raku / Addendum 🆕 / Working with data / Lists, arrays, and hashes / Exercises

Split into even and odd

Problem

Split the numbers 1 to 10 into two groups — even and odd — and print each group on its own line.

Example

The program prints:

even: 2 4 6 8 10
odd: 1 3 5 7 9

Solution

See the solution

Course navigation

Solution: The second-largest value   |   Solution: Split into even and odd