what's the difference between an argument and a parameter. My friend and i are going nuts over this question.
difference between argument and parameter
Collapse
X
-
For example, if you have this function:
and call it like this:Code:def explain_param_vs_arg(param1, param2): print param1, param2
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.Code:explain_param_vs_arg("arg1", "arg2")
Hope this makes sense. -
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
regardsComment
-
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
Comment