In functional programming, what makes a function purely functional?
No side effects: its output depends only on its input.
- It is written in one line
- It runs faster than a loop
- It has no side effects; output depends only on input ✔
Why: A pure function never changes outside data, prints, or saves anything. Give it the same input and you always get the same output, which makes it easy to test and safe to run in parallel.
Huh, didn't know that: Python supports several paradigms at once: procedural, object-oriented and functional styles can all be mixed.
My functional code has no side effects. Unlike my cooking.
References
Answer: It has no side effects; output depends only on input. A pure function never changes outside data, prints, or saves anything. Give it the same input and you always get the same output, which makes it easy to test and safe to run in parallel.
- Python docs: Functional Programming HOWTO docs.python.org/3/howto/functional.html
Functions that have no side effects at all
Checked 2026-10-11.
Think this answer is wrong? Tap "Challenge this answer" on the card in the game and tell us why.
More stuff everyone should know
That's stuff everyone should know.