[Tutor] parameters vs arguments

Kent Johnson kent37 at tds.net
Thu Nov 5 02:42:56 CET 2009


On Wed, Nov 4, 2009 at 8:08 PM, Kristin Wilcox <wilcoxwork at gmail.com> wrote:
> I'm reading stuff from multiple sources, and it seems to me like the words
> "parameters" and "arguments" are used interchangeably. But I'm not sure if
> this is a wrong perception, due to my lack of understanding, or if these
> terms are truly synonyms.

Wikipedia has a nice description:
http://en.wikipedia.org/wiki/Parameter_%28computer_science%29#Parameters_and_arguments

Short view - technically, parameters are the variables in the function
and arguments are the values given to the variables at the point of
call. So outside the function, it is more common to talk about
arguments. Inside the function, you can really talk about either.
> When I define, say, function example like this...
> def example(x,y):
>
> are x and y arguments? or parameters?

Parameters that will take on the value of the arguments passed to the function.

> And when I call the function and pass it values
>
> example(32,17) are those values arguments or parameters? I *thought* this
> was called 'passing arguments'...

Arguments.

> I actually thought x and y would be referred to as arguments in both cases,
> but then sometimes I think I hear them called parameters.
>
> Help? Am I missing some nuances here?

Not really, it is not an important distinction.

Kent


More information about the Tutor mailing list