Python functions are named blocks of code designed to perform specific tasks and can be reused in different parts of a program. Functions help organize code, making it more modular, reusable, and easier to maintain. Python has built-in functions like print(), len(), and input() that are always available. Users can also create their own functions, known as user-defined functions, using the def keyword.
Guido van Rossum created Python, releasing it first in 1991. When defining a function, one specifies a name and any parameters within parentheses. The function's code block, or body, begins with a colon and is indented. Functions can accept arguments, which are values passed into the function when it is called, and can return data as a result using the return statement. Python supports multiple programming paradigms, including procedural programming through the use of functions.
The price of using Python functions is free, as it is an open-source language. Python is currently available, with the Python Software Foundation supporting versions 3.10, 3.11, 3.12, 3.13 and 3.14 as of 2026. Python 3.15 is in alpha development, with a stable release expected in October 2026.