Python Parameters and Arguments
Objective 4.2 is organise interaction between the function and its environment, and the argument side of it is the most rule-heavy part of PCEP. There are three ways to pass a value and two ways to collect extra ones; there are four different errors an argument list can produce, two of them at compile time; and there is one default value that behaves in a way nobody expects until they have seen it happen.
Functions and Scope Guide 19 of 26 Intermediate
- Python3.14.4
- OSUbuntu 26.04 LTS
- pip25.1.1
- TimeAbout 19 min
- Reviewed23 August 2026
Written against the versions above. Positional-only parameters (`/`) arrived in Python 3.8 and keyword-only parameters (`*`) in 3.0. Neither is on the PCEP syllabus and neither appears here. Everything on this page has been true since Python 3.0.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| RUNNER01 | 192.168.0.27 | Ubuntu 26.04 LTS | Python 3.14.4 - the only machine this path needs | 2 Core | 4 GB | 50 GB |
Before you start
- guide 18 - the first half of the function material.
- guide 14 - the mutable default step depends on aliasing.
-
The words, because questions use them precisely
-
Collecting the rest: *args and **kwargs
-
Three ways a call is rejected at run time
-
Two ways a call is rejected before anything runs
-
The default that is evaluated once
-
The fix, and why it is written that way
-
What a function can and cannot change about its caller
-
What the exam does with this objective