Skip to content
BENIBIX Learn

Function Call

Development🧩 Programming ConceptsFunctions

Also known as Calling a Function, Invoke

The line that runs a function. You write its name, then brackets, like greet("Emma").

Think of it like

Think of it like ringing a pizza shop. You say what you want, wait, and the pizza comes back to you.

Example

Jack's game calls play_sound("coin") every time the player picks up a coin. The same function runs 40 times in one level.

Why it matters

Writing a function does nothing until it is called. The call is what actually runs it.

Definition

A function call is the line that runs a function. You write the function's name with brackets after it, like greet("Emma"). The program jumps into the function, runs it, then comes back to the same spot. Any arguments go inside the brackets. If the function returns a value, the call works out to that value.

Example code

python
>>> len("Jack")
4
The name len plus brackets runs the function. The answer is 4.

Common mistake

Leaving off the brackets. greet names the function; greet() runs it.

Key takeaways

  1. 1
    Name plus brackets. The brackets are what make it run.
  2. 2
    Jump and come back. The program returns to the same line.
  3. 3
    Works out to the result. The call takes the returned value.

Learn it properly