Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Functions in Python

In Python, a function is a named sequence of statements that performs a computation.

To execute a function, we call it by name and pass it an appropriate set of input arguments. A function takes zero or more arguments as inputs and returns zero or more outputs as a result. The output or result of a function is called the return value.

Data, parameters, or arguments can be passed into a function. Functions can also return data.

Section Contents