In functional programming, what makes a function purely functional?

No side effects: its output depends only on its input.

Start playing free

  1. It is written in one line
  2. It runs faster than a loop
  3. 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.

The dad joke
My functional code has no side effects. Unlike my cooking.
Like this card?
Play the game

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.

  1. 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.

Test yourself in the game