What the Argument? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What the Argument?

I'm not understanding

27th Feb 2017, 3:34 PM
Mohamed alfadul Dia aldein
Mohamed alfadul Dia aldein - avatar
3 Answers
+ 8
def square(n): #n is a parameter return n*n print(square(4)) #4 is an argument A parameter is the data embraced by () in the function definition. The argument is the value passed by the user when the function is called
1st Mar 2017, 10:44 AM
LayB
LayB - avatar
+ 3
'Argument' is another word for 'parameter'... When you call a function, mostly, you need to pass data to it, to do some tasks with it. You put them in parameters of your function as arguments in between the parenthesis ( round backets ) nexted the function name: myFunction(anArgument, anotherParameter) In first practical example of the Python course you've started, you'll do: print("Hello world!") ... you are calling the function 'print' and passing to it the value "Hello world!" for displaying it at output. The value passed is called as well 'parameter' as 'argument' :P Redo first parts of course if needed, and feel free to test and practice the examples by clicking on 'try it yourself' links: you'll get it ;)
28th Feb 2017, 1:49 PM
visph
visph - avatar
+ 1
what?
27th Feb 2017, 8:00 PM
Арсен Дарбишев
Арсен Дарбишев - avatar