5 Types of Arguments in Python Function Definitions

Learn about different types of arguments used in the python function definition

Indhumathy Chelliah
Level Up Coding
Published in
6 min readSep 2, 2020

--

Photo by Sharon McCutcheon from Pexels

5 Types of Arguments in Python Function Definition:

  1. default arguments
  2. keyword arguments
  3. positional arguments
  4. arbitrary positional arguments
  5. arbitrary keyword arguments

Python Function Definition:

The function definition starts with the keyword def. It must be followed by the function name and the parenthesized list of formal parameters. The statements that form the body of the function start at the next line and must be indented. — python docs

Formal parameters are mentioned in the function definition. Actual parameters(arguments) are passed during a function call.

We can define a function with a variable number of arguments.

1. default arguments:

  • Default arguments are values that are provided while defining functions.
  • The assignment operator = is used to assign a default value to the argument.
  • Default arguments become optional…

--

--