+ 2
Pure and impure functions??
What is really the difference between them?What a pure function?
1 Answer
+ 1
A pure-function takes its input arguments to produce an output without affecting any external state like, for example, global variables.
Moreover, a pure-function does not use external states like, for example, random.randint (1,100) which is external to the function and its input values.
In the other side are impure-functions which affect external states or produce outputs using them.