You use functions to break up the code into pieces. Each function should perform one task, if it’s more than that, it can be broken up into even more functions (that’s sort of what abstraction is).
Some functions may need to return a value, but some may not at all. If you have a function that just deletes a file, you don’t need to return anything from it. But if you have a function that adds two numbers, you need to return the result.
Latest Answers