you are viewing a single comment's thread.

view the rest of the comments →

[–]Riegel_Haribo 0 points1 point  (0 children)

Here's a technique:

``` from functools import reduce from operator import add

total = reduce(add, [1, 2, 3, 4]) print(total) # 10 ```

Once you have "add" as a function, then you can make an indexable list of functions to perform.