parameter
A name in a function definition that receives the value of an argument each time the function is called.
In more detail
Parameters are local variables of the function, filled in at the moment of the call. A function with several parameters receives arguments in order. A default, as in end='\n', makes a parameter optional.
Example
def sumProblem(x, y):
print(x + y)Related terms
- argument — A value you pass to a function when you call it, written inside the parentheses of the call.
- def — The Python keyword that starts a function definition: def, the name, parameters in parentheses, a colon, then an indented body.
- local variable — A variable that exists only inside one function call and cannot be seen or changed from outside it.
- keyword argument — An argument passed by naming the parameter it is for, as in print(x, end=""), instead of by position.
Taught in
- Types And Functions, A Whirlwind Tour — Hands-on Python: Complete Video Course & Book
- The Print Function And String Literals — Hands-on Python: Complete Video Course & Book
- Input, And Numbers Versus Digits — Hands-on Python: Complete Video Course & Book
- The String Format Method — Hands-on Python: Complete Video Course & Book
- Function Parameters — Hands-on Python: Complete Video Course & Book
- Multiple Parameters — Hands-on Python: Complete Video Course & Book
- Functions, Return Values And Recursion — PCEP Certified Entry-Level Python Programmer (PCEP-30-02) Exam Prep
- Parameters, Arguments And Scope — PCEP Certified Entry-Level Python Programmer (PCEP-30-02) Exam Prep
- Functions And Exceptions Sprint — PCEP Certified Entry-Level Python Programmer (PCEP-30-02) Exam Prep
- Classes, Objects And Two Stacks — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep
- Class Variables, Instance Variables And __dict__ — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep
- Methods And The self Parameter — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep
- Inheritance, super() And Polymorphism — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep
- Lambdas, map() And filter() — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep
- Comprehensions, Closures And Files Sprint — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep