A function is a self-contained block of code that takes input, performs some computation, and returns an output. A function is only executed when it is called. Go Back