Skip to content

Functions

Beginner · Fundamentals

Learn how to write reusable and meaningful code by using functions.

Define the function that main calls.

Show hint
The main function is calling another function that it expects to exist.
It expects a function named `call_me` to exist and receive no arguments.

Source

Function parameters must declare their types.

Show hint
Function parameters need to have their types explicitly declared.

Source

Call a function with the argument it expects.

Show hint
When a function expects arguments, you must pass values to them.

Source

A function returning a value must declare its return type.

Show hint
Functions that return values must have return types declared in the function signature.

Source