Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1
Impure function changes the value of variables, lists and other things outside the function.e.g. A = [1,2,3,4] def imp_func (num): A.append(num) thus changing the variable of variables outside the function is the side effect is impure function. There are some problems of using high level languages, we don't allocate memory anymore using python for instance. Imagine a function that takes a variable as an argument, but in the time the function is processed the value is changed, making the program do things like flood the whole memory and crash the system.
11th Jun 2019, 5:30 AM
Dipra Irham
Dipra Irham - avatar