Functions

To summarize, here is a quick breakdown of the distinction between a parameter and an argument:

  • The parameter is the name defined in the parenthesis of the function and can be used in the function body.

  • The argument is the data that is passed in when we call the function, which is then assigned to the parameter name.

Types of Arguments

In Python, there are 3 different types of arguments that a function can have:

  • Positional arguments: arguments that can be called by their position in the function definition.

  • Keyword arguments: arguments that can be called by their name.

  • Default arguments: arguments that are given default values.

Last updated