- Parameter: the name in the function definition — def burn(fuel): → fuel is a parameter. - Argument: the actual value you pass in the call — burn(40) → 40 is an argument.
People mix them up all the time and everyone understands, but that's the precise difference.
Comments 4
Join the discussion CommentAlready have an account? Log in
- Parameter: the name in the function definition —
def burn(fuel):→fuelis a parameter.- Argument: the actual value you pass in the call —
burn(40)→40is an argument.People mix them up all the time and everyone understands, but that's the precise difference.
Placeholder vs actual value. Clear, thanks!
Yep, that error confused me until I realised it meant I forgot to pass a value.
Error messages use them correctly, e.g. "missing 1 required positional argument", so it helps to know the difference.