What's the difference between calling a function and returning a function? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What's the difference between calling a function and returning a function?

I'm quite confused 🤔 with this quote.. cn anyone help to move out from this problem

28th Nov 2020, 12:14 PM
Rishbabh Sharma
Rishbabh Sharma - avatar
2 Answers
+ 1
A function is something whic take parameters and do some calculations and operations and returns value. Now your question is what are they Function: It is simply a set of various processes Return value: It is final result after all calculations are done. Which is returned by function from where it is called.
28th Nov 2020, 12:26 PM
Ayush Kumar
Ayush Kumar - avatar
+ 1
Calling a function means saying function, do this. You basically call a function, you don't return it. A function can do something, print something or return something. That's where the return comes in. Example of return: def add(x,y): return x + y You then call the function with: add(value of x, value of y) If you want the result printed: print(add(value of x, value of y)) Happy Coding 😀
28th Nov 2020, 1:19 PM
Tomiwa Joseph
Tomiwa Joseph - avatar