All certifications / PCEP / Lessons
PCEP PCEP-30-02 lessons
Study PCEP for free
A week-by-week plan with every lesson, quizzes, checkpoint tests, a practice exam and hands-on labs.
Open the PCEP study planA week-by-week plan with every lesson, quizzes, checkpoint tests, a practice exam and hands-on labs.
Domain 1: Computer programming and Python fundamentals
- Fundamental terms: interpreting vs compiling, lexis, syntax and semantics, source code and the Python interpreter
- Python logic and structure: keywords, instructions, indentation and comments
- Literals: Boolean, integer, float, scientific notation and string literals
- Binary, octal and hexadecimal integer literals (0b, 0o, 0x)
- Variables and naming rules, reserved keywords and PEP 8 naming conventions
- Numeric operators: ** * / % // + - and the difference between / and //
- String operators (+ and *), assignment and compound assignment operators (+=, *=, etc.)
- Operator priority and binding, including right-to-left ** and unary minus
- Bitwise operators: ~ & ^ | << >>
- Boolean and relational operators, float accuracy and rounding surprises
- Type casting with int(), float(), str() and bool()
- Console I/O: print() with sep= and end=, input() returning a string, converting input to numbers
Domain 2: Control flow: conditional blocks and loops
- If, if-else and if-elif-else statements, and why the order of elif conditions matters
- Multiple conditions with and, or and not; truthy and falsy values
- Nested conditional statements and indentation
- The pass instruction as a placeholder body
- While loops, loop conditions and avoiding infinite loops
- For loops over range() with start, stop and step, including negative steps and empty ranges
- Iterating over strings, lists and other sequences with for
- Break and continue, and how break affects only the innermost loop
- While-else and for-else: when the else clause runs and when break skips it
- Nested loops and counting iterations
- The value of the loop variable after a for loop ends
Domain 3: Data collections: tuples, dictionaries, lists and strings
- Lists: building, indexing (including negative indexes) and slicing
- List methods and functions: append(), insert(), index(), remove(), sort(), len(), sorted(), del
- Iterating through lists, in and not in, list comprehensions with conditions
- Copying vs aliasing lists: b = a compared with a[:] or list(a)
- Nested lists and matrices (list of lists)
- Tuples: building (including one-item tuples), indexing, slicing, immutability and tuples vs lists
- Dictionaries: building, indexing, adding, changing and removing keys
- Iterating dictionaries with keys(), values() and items(); checking whether a key exists
- Strings: indexing, slicing (including [::-1]), immutability and comparison
- Escaping with \, quotes and apostrophes inside strings, multi-line strings
- Common string methods: split(), join(), upper(), lower(), strip(), find(), count(), replace()
Domain 4: Functions and exceptions
- Decomposition: splitting a program into functions
- Defining and invoking functions; functions must be defined before they are called
- Return and yield, returning several values as a tuple, the None value
- Recursion, base cases and RecursionError
- Parameters vs arguments; positional, keyword and mixed argument passing
- Default parameter values and why defaults must follow required parameters
- Name scopes, shadowing and the global keyword; UnboundLocalError
- The exception hierarchy: BaseException, Exception, SystemExit, KeyboardInterrupt, ArithmeticError, LookupError
- Common built-in exceptions: ZeroDivisionError, IndexError, KeyError, TypeError, ValueError, NameError
- Try-except, except with several exceptions, bare except and except Exception
- Ordering except branches from specific to general
- Propagating exceptions through function boundaries and deciding where to handle them