Saltar al contenido

Lesson 5: Functions

English

Your own commands

  • A function is a name for some lines of code. def square(size): makes a new command called square.
  • size is a parameter: a value you give the function each time you call it.
  • main() is a function too. You have used it from the start.

Words for this lesson

Word Meaning
function a named group of commands
def define (make) a function
parameter a value the function gets, like size
call run a function: square(300)

Iniciar sesión o crear cuenta

IGCSE, A-Level & AP