Course of Raku / Functional, concurrent, reactive, and web programming / Functional programming / Reduction / Exercises

Sum a list

Problem

Using the reduce metaoperator, print the sum of the list 10, 20, 30, 40.

Example

The program prints:

100

Solution

See the solution

Course navigation

Quiz — Reduction   |   Solution: Sum a list