ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-tutor
python-tutor
Re: [Tutor] parameters vs arguments
by Modulok other posts by this author
Nov 4 2009 9:00PM messages near this date
[Tutor] parameters vs arguments | Re: [Tutor] parameters vs arguments
[snip]
>  When I define, say, function example like this...
>  def example(x,y):
> 
>  are x and y arguments? or parameters?
> 
>  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'...
> 
>  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?
[/snip]

For all practical intents and purposes, they're synonymous. But there
*is* a difference if you want to get technical about it.

As far as the terminology goes, it can depend on the language you're
using. Since a lot of programmers use more than one language, a lot of
terminology gets borrowed across language lines. Strictly speaking the
'parameter' is the variable which stores arbitrary data, that is
addressable within the function body. The specific data being passed,
is the 'argument'. For example:

def foo(arg):
   print arg

foo("spam and eggs")

The variable 'arg' in the function definition would the the
'parameter' and the value "spam and eggs" in the function call would
be an 'argument' to that parameter. ...strictly speaking. In reality,
some language texts may have a preference for one term over the other,
due to the author's background and previous languages they've used.
For all practical intents and purposes, they're synonymous and
frequently used interchangeably.

-Modulok-
_______________________________________________
Tutor maillist  -  Tutor@[...].org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Thread:
Kristin Wilcox
Modulok
Binto
Alan Gauld
Binto
Kent Johnson

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved