In programming, there are two main types of parameters:
- Formal Parameters:
- These are the parameters that are defined in the function or method declaration.
- They act as placeholders that specify what kind of values the function expects to receive when called.
- Example:
`
python
def greet(name): # 'name' is a formal parameter
print(f"Hello, {name}!")
`
- Actual (or Argument) Parameters:
- These are the real values or data that are passed to the function when it is called.
- These values are given to the function in place of the formal parameters.
- Example:
`
python
greet("Alice") # "Alice" is an actual parameter
`
So, in simple terms,
formal parameters are what you define in the function, and
actual parameters are what you pass when you call the function.