Step 1: Compare the two in the function call:
Take the call calc(1). Only one argument is sent.
The parameter a has no preset value, so it takes the 1 that was sent. This is a positional parameter.
The parameters b and c have preset values in the header, so Python fills them itself. These are default parameters.
Step 2: State the difference:
A positional parameter is compulsory. Leaving it out gives a TypeError.
A default parameter is optional. Leaving it out is safe, because its default value is used.
In the header, every default parameter must sit after the positional ones. A header such as def f(a=1, b): is a syntax error.
Step 3: Show the header and check it:
def calc(a, b=10, c=20):
return a + b + c
print(calc(1))
print(calc(1, 2))
print(calc(1, c=5))
Output of the three print lines: 31, 23 and 16.
The first value goes to a every time. This shows a is positional and b, c are default.
Final Answer:
Positional parameter: no preset value, must be passed, matched by order. Default parameter: has a preset value, may be left out.
Header using both:
def calc(a, b=10, c=20):