#python #scip
Pure functions have the property that applying
them has no effects beyond returning a value. Moreover, a pure function must
always return the same value when called twice with the same arguments.
If you want to change selection, open document below and click on "Move attachment"
1.2 Elements of Programmingsome input (their arguments) and return some
output (the result of applying them). The built-in function
>>> abs(-2)
2
can be depicted as a small machine that takes input and produces output.
The function abs is pure. <span>Pure functions have the property that applying
them has no effects beyond returning a value. Moreover, a pure function must
always return the same value when called twice with the same arguments.
Non-pure functions. In addition to returning a value, applying a non-pure
function can generate side effects, which make some change to the state of the
interpreter or computer. A co Summary
status | not read | | reprioritisations | |
---|
last reprioritisation on | | | suggested re-reading day | |
---|
started reading on | | | finished reading on | |
---|
Details