Learn
Functions
Calling a Function
To call a function, we need to use the function's name, followed by parentheses (). The parentheses are essential, as they indicate to the programming language that we want to execute the function.
Example:
In the example above, we have defined a function greet()
that prints a greeting message. By calling the greet()
function, we execute the code within the function, and the message "Hello, welcome!" will be displayed in the console.
Instructions
1.
Call the greet
function.
The function should print "Hello!"
to the output.
Sign up to start coding
Already have an account?
Sign In
Course content