6. Functions
Functions are the best tools for writing reusable code blocks. Whenever we write codes, we often see that we need to execute the same task in multiple places in our program. What if we could separate the code for that particular task from the main code block and call it every time we need to do it instead of writing the same code again?
So, in short, a function is a code block where we can do certain tasks. We can provide it with data and receive a result from it.
Last updated
Was this helpful?