Functions
What are functions?A function is a named section of code designed to perform a particular task. A function can be called whenever that task needs to be performed, allowing the same code to be reused rather than written repeatedly.
Definitions and vocabularyA function is a sequence of program instructions that performs a specific task and usually returns a value. This function (block of code) can be called (used) throughout the program by its defined name. In computer science, functions return a value. If a function does not return a value it is called a procedure. In Python, the For VCE Applied Computing, you need to know the difference between a function, a method and a procedure. We will cover methods later in the course. |
|
Here you would be directed to a source of additional reading. |