Parameters and Arguments
You’ll learn about what parameters and arguments are in Python in this lesson.
Parameters vs arguments
With no additional syntax, arguments (expressions in a function call) are matched to parameters (variables in a function definition) by position. The first parameter gets the value of the first expression, and so on.
Introduction to parameters
Parameters in a function definition may be:
- A simple variable that is matched to an argument by position. Positional parameters must precede any other parameters.
variable=value
: to give a default value for missing arguments.*args
- to accept multiple arguments as a single tuple. By