The operator
Module and Functional Programming
Functional programming is a paradigm that consists of building a program from small functions that perform specific tasks and that can be passed as arguments to other functions to express complex operations. The standard operator
module makes it easy to write functional code (along with the functools
and itertools
modules) by exposing Python operators (for example, the addition operator +
or the item access operator []
) as functions. This is useful because functions, unlike operators, can be stored in variables and passed as arguments.