What does function mean?

A named block of code that does one job and can be called from anywhere in a program. It may take parameters and may return a value. Also called a subroutine or, when it returns nothing, a procedure.

Also written as: functions, subroutine, subroutines, procedure

In a lesson

The functions in the last lesson did the same thing every time. Real functions take information in and give an answer back, the way forward(50) takes a speed and distance() gives a number. This lesson is about both directions.

Learn it

Used in

and 134 more lessons.

Do the lesson in the simulator

All glossary terms