Videos
I am trying really hard to understand specifically parameters. Particularly, when I define a function I.e. def function(parameter): print(parameter) And then call it function("a simple string") Is the parameter always going to be parameter? It's receiving a value, right? So... Maybe I'm like mentally deficit... or overthinking this, but what if I do..
def function(parameter0, parameter1, parameter3)
print(parameter0, parameter1, parameter3)And then call the function
function("Does this cause an error?", "Must have exact values", "for each parameter?")Am I over thinking this? I'm just following lessons from a PDF. Python for the absolute beginner
I'm must confused and I'm not even sure how or why I'm confused.
-
Edit: formatting and typos
-
Update: Thanks everyone for your help. I think I am understanding it. I believe I'm overthinking it, and over reacting. Sorry for being difficult.
A parameter is a variable in a method definition. When a method is called, the arguments are the data you pass into the method's parameters.
public void MyMethod(string myParam) { }
...
string myArg1 = "this is my argument";
myClass.MyMethod(myArg1);
Parameter is the variable in the declaration of the function.
Argument is the actual value of this variable that gets passed to the function.