This article explains Python’s various function arguments with clear examples of how to use them. But before learning all function arguments in detail, first, understand the use of argument or parameter in the function.
Table of contents
What is a function argument?
When we define and call a Python function, the term parameter and argument is used to pass information to the function.
- parameter: It is the variable listed inside the parentheses in the function definition.
- argument: It is a value sent to the function when it is called. It is data on which function performs some action and returns the result.
Example:
In this example, the function sum_marks() is defined with three parameters, a, b, c, and print the sum of all three values of the arguments passed during a function call.
Output:
Total is: 120