A parameter is simply a placeholder in a function definition that represents what will be passed to that function for use in the body of the function.
For example, say I wanted to create a function that calculates the price of an arbitrary used car. Some relative parameters might be
In our function definition, we would list these parameters because we expect the corresponding variables to be passed to the function when we call it later in the program. That would look like this:
def used_car_price(year, condiiton, make, model):
year_value = 2016 - year
if condition == "new":
condition_value += 1000
make_value = getMakeValue(make)
model_value = getModelValue(model)
This is just an example, but as you can see, the parameters in the function definition correspond to the variables we use inside the function. A call to the function would look like:
used_car_value(2009, new, BMW, 528i)
528i are our parameters.
Parameters are especially helpful when you consider the alternative of declaring several global variables, which can interfere with the rest of your program. Parameters are temporary and are only in the scope of the function they belong to.
Hope this helps!