September 2026
1051 pages
35h 4m
English
From mathematics, you know the term function, which designates an assignment rule. For example, the function f(x) = x2 assigns the parameter x its square. In the mathematical sense, a function consists of a name, a list of parameters, and a calculation rule for the function value.
In programming, you can also find the mathematical concept of a function. For example, we have already discussed the built-in len function, which calculates the length of an iterable object. To do this, the object is passed as an argument to the corresponding function, which returns the result as a return value:
>>> len("This string is an argument")26
Obviously, there is some analogy here to the mathematical concept of a function. A function in programming ...
Read now
Unlock full access