difference between argument and parameter

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cooolsson
    New Member
    • Oct 2008
    • 5

    difference between argument and parameter

    what's the difference between an argument and a parameter. My friend and i are going nuts over this question.
  • boxfish
    Recognized Expert Contributor
    • Mar 2008
    • 469

    #2
    For example, if you have this function:
    Code:
    def explain_param_vs_arg(param1, param2):
        print param1, param2
    and call it like this:
    Code:
    explain_param_vs_arg("arg1", "arg2")
    The variables param1 and param2 are the parameters, and the values that you give them, in this case "arg1" and "arg2", are the arguments. Wikipedia explains. This question could have been easily googled. In fact, that's what I did.
    Hope this makes sense.

    Comment

    • cooolsson
      New Member
      • Oct 2008
      • 5

      #3
      Thanks for the answer. Now i can sleep at night.

      Comment

      • gaurav1086
        New Member
        • Oct 2008
        • 4

        #4
        there's as much difference as between a normal function and an inline function(or u may call it a macro). One is used in a simpler way (parameters) while the other in a more versatile way(arguments). thats all
        regards

        Comment

        • exepaul
          New Member
          • Oct 2016
          • 1

          #5
          unctions have parameters (def fn(parameter):) , and function calls have arguments (fn(argument)).

          Parameters are defined by the names that appear in a function definition, whereas arguments are the values actually passed to a function when calling it. Parameters define what types of arguments a function can accept.

          Comment

          • Oralloy
            Recognized Expert Contributor
            • Jun 2010
            • 988

            #6
            Common use seems to have both confused and used indiscriminatel y in conversation. One can talk about the parameters used to call a function or arguments in the function.

            Us programmers aren't quite as precise about language as we aught.

            Comment

            Working...