argument meaning
what do you mean by argument of five? in code
""""""""""""""""""def five(x)
how to define it
also what does the return(x) means after defining argument
3 answers ( 0 marked as helpful)
Hi Tushar!
Thanks for reaching out!
When we define a function, by typing five(x), x is a parameter. I.e. x indicates that in its place, there will be a value, with which a certain operation will be applied.
In our (very simple) function, the operation to be applied is x = 5.
Then, when you call/invoke the function, which means - when we use it in practice (i.e. after it has been defined), then we don't use parameters anymore. We use arguments instead.
So, argument is just a different term that we use when a certain function has been applied.
Therefore, in our example, we define a function called five with a parameter x. The operation to be applied is x = 5, which means that whichever argument we use when calling the function, it will be made equal to 5.
return (x) is a command that indicates what value we want the function to return to us.
Please remember that all these explanations will be made clearer in the Functions section of the course.
Hope this helps.
Best,
Martin
Best,
Martin
oh my god, thanks. you made it so easy to understand.
sсс