🧩Parameter
Also known as Function Parameter
A name in a function. It holds the value the function is given later.
Think of it like
Think of it like a blank line on a form. The form says Name, and each person writes their own.
Example
The function area(width, height) has two parameters. Called with 3 and 4, width is 3 and height is 4.
Definition
Example code
python
def area(width, height):
return width * height
print(area(3, 4)) # 12Common mistake
Key takeaways
- 1A named blank. It waits for a value from the call.
- 2Set by position. The first value fills the first name.
- 3Lives inside. It only exists within its function.