> For the complete documentation index, see [llms.txt](https://drlilianblot.gitbook.io/introduction-to-programming-with-python/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://drlilianblot.gitbook.io/introduction-to-programming-with-python/a-deeper-look-at-functions-in-python/functions-side-effects.md).

# Functions' side effects

In the video below, we will talk about the side effects of function calls in Python. Side effects are any changes that a function makes to the state of the program or the environment outside of its own scope. For example, a function that writes to a file, or modifies a global variable has side effects. Side effects are not necessarily bad, but they can make your code harder to understand, test, and debug.&#x20;

In general, it is good practice to minimise the side effects of your functions and make them as pure as possible. A pure function is one that only depends on its input parameters and returns a value without changing anything else. Pure functions are easier to reason about, reuse, and optimise.

{% embed url="<https://youtu.be/xKXak9yHn7w?si=VDdJbX-1p1BggImr>" %}
