Course of Raku / Functional, concurrent, reactive, and web programming / Functional programming / Reduction / Exercises / Sum a list
Solution: Sum a list
Here is a possible solution to the task.
Code
say [+] 10, 20, 30, 40;🦋 You can find the source code in the file sum-list.raku.
Output
100Comments
[+]inserts+between every element of the list.The sum
10 + 20 + 30 + 40is100.
Course navigation
← Sum a list | Product of a list →