CertGrid CertGrid
Concepts·Certified Entry-Level Python Programmer

Python Function Definition and Calls

Objective 4.1 is decompose the code using functions, and the syntax is one keyword. What gets examined is what surrounds it: a function with no return returns None, a function must be defined before the line that *calls* it rather than before the line that mentions it, and a function name is an ordinary variable that can be overwritten - including one of the built-in ones.

Functions and Scope Guide 18 of 26 Beginner

Nothing here has changed in Python 3. Type annotations on parameters are legal and are not examined by either exam; none of this path uses them.

One machine, and any shell with Python 3 will do - these exams test the language, not a distribution.
Server NameIP AddressOSRolesCPURAMHDD
RUNNER01192.168.0.27Ubuntu 26.04 LTSPython 3.14.4 - the only machine this path needs2 Core4 GB50 GB

This guide includes

Use this for the function-definition objective. This matters because def is a statement that runs - so a function has to exist by the time it is called, and a function name has no protection, not even a built-in one.

Before you start

  1. def, and what a call gives back

  2. return ends the call immediately

  3. A function must exist by the time it is called

  4. Returning more than one value

  5. A function name has no protection, not even a built-in one

  6. What the exam does with this objective

Official sources