0
dont understand the pythin code
hello, could you please elaborate on the following code? I didn't Understand it. def multiply(x, y): return x * y a = 4 b = 7 operation = multiply print(operation(a, b)) https://code.sololearn.com/338/#py thank you.
6 Respuestas
+ 4
try
print(multiply(a,b))
link the code in a comment
+ 4
Also
multiply and multiply()
are different things.
I do not think function can be copied
by just using the "=" operator
+ 3
you're defining a function with two parameters that return the multiplication of
(x*y)
then you're defining two variables
then you passing the location of the the function "multiply" to "operation" so now both have access to the location of that function and can use it . it's like object reference of another object because functions are objects . you are referencing another object . is not so cool ?
you can also impad functions inside another functions
+ 2
Here is an example
https://code.sololearn.com/cEbV26Khj4l9/?ref=app
0
so what is your code explaining? I didn't get that!!
I shared te link by the way