Domain 1: Computer Programming and Python Fundamentals
- Python is an interpreted language: the CPython interpreter compiles source to bytecode and executes it line by line, so many errors surface only when a statement actually runs rather than ahead of time.
- Numeric literals include integers (int) and floating-point numbers (float), plus the Boolean values True and False, which are a subtype of int equal to 1 and 0; you can write floats with a decimal point or scientific notation like 1.5e3.
- True division with / always produces a float (7 / 2 is 3.5), while floor division with // discards the fractional part toward negative infinity (7 // 2 is 3, and -7 // 2 is -4).
- The modulo operator % returns the remainder (7 % 3 is 1), and exponentiation uses ** which is right-associative, so 2 ** 3 ** 2 evaluates as 2 ** (3 ** 2), giving 512.
- Operator precedence runs exponentiation first, then unary sign, then multiplication and division, then addition and subtraction; parentheses override precedence and equal-precedence binary operators evaluate left to right (except **).
- Variable names may contain letters, digits, and underscores but cannot start with a digit, cannot be a reserved keyword, and are case-sensitive, so total and Total are different variables.
- The print() function sends output to the screen and accepts the sep argument (the separator placed between values, default a single space) and the end argument (what is printed after, default a newline).
- The input() function always returns the user's entry as a string, so you convert it with int() or float() before doing arithmetic; the + operator concatenates two strings while * replicates a string a given number of times.
- Comments begin with # and run to the end of the line, and the type() function reports an object's type while int(), float(), and str() perform simple conversions between numbers and text.
Domain 2: Control Flow - Conditional Blocks and Loops
- Comparison operators (==, !=, >, <, >=, <=) produce Boolean results, and == tests value equality while = performs assignment, so confusing the two is a common mistake.
- The logical operators and, or, and not combine Booleans, where and requires both operands to be true, or requires at least one, and not inverts a value; and and or also short-circuit and can return one of their operands.
- Any value has a truthiness: 0, 0.0, empty strings, empty collections, and None are treated as false, and most other values are treated as true when used in a condition.
- An if statement runs its block when the condition is true; optional elif branches test further conditions in order and an optional else runs when none matched, so only the first true branch executes.
- Indentation defines a block in Python, and conditionals can be nested inside one another, so aligning the correct number of spaces determines which statements belong to which branch.
- A while loop repeats its body as long as its condition stays true, so you must change a variable inside the loop to eventually make the condition false and avoid an infinite loop.
- A for loop iterates over the items of a sequence, and range(start, stop, step) generates integers from start up to but not including stop; range(5) yields 0 through 4 and a negative step counts down.
- The break statement exits the innermost loop immediately, while continue skips the rest of the current iteration and jumps to the next one.
- A loop may have an else clause that runs only if the loop finished normally without hitting break, and the pass statement is a do-nothing placeholder that satisfies Python's need for a statement in an empty block.
Domain 3: Data Collections - Tuples, Dictionaries, Lists, and Strings
- A list is an ordered, mutable sequence written with square brackets; indexing is zero-based so the first item is index 0, and negative indices count from the end, with -1 being the last item.
- Slicing with list[start:stop:step] returns a new list from start up to but not including stop; omitted bounds default to the ends, and a step of -1 reverses, so list[::-1] gives a reversed copy.
- Common list methods include append() to add one item at the end, insert() to add at a position, sort() and reverse() to reorder in place, and the del statement to remove an item by index or a slice.
- A basic list comprehension builds a new list from an iterable in one expression, such as [x * x for x in range(5)], optionally with a filtering if clause like [x for x in nums if x > 0].
- Lists can be nested to form two-dimensional structures such as a grid, where an element is reached with two indices like matrix[row][col].
- A tuple is an ordered but immutable sequence written with parentheses; you cannot change its items after creation, and packing assigns several values into one tuple while unpacking spreads them back into separate variables.
- A dictionary stores key-value pairs; you read a value by its key, the keys() view lists keys, values() lists values, and items() yields key-value pairs, while get() returns a default instead of raising when a key is missing.
- You add or update a dictionary entry by assigning to a key, remove one with del or pop(), and iterating a dictionary directly loops over its keys; keys must be unique and hashable.
- Strings are immutable sequences of characters that support indexing, slicing, and len(); methods like upper(), lower(), replace(), find(), and split() return new values, and the in and not in operators test membership in strings, lists, tuples, and dictionary keys.
Domain 4: Functions and Exceptions
- You define a function with the def keyword followed by a name and a parameter list, and calling the function runs its body; parameters are the names in the definition while arguments are the actual values passed at the call.
- Arguments can be passed positionally (matched by order) or by keyword (matched by name), and default parameter values let a caller omit an argument, so a keyword argument can override just the parameters you care about.
- The return statement sends a value back to the caller and ends the function; a function with no return, or a bare return, hands back None automatically.
- Names assigned inside a function are local to that call and disappear when it ends, while names defined at the top level are global; a local name that matches a global one shadows it inside the function.
- The global keyword inside a function lets you rebind a module-level variable rather than creating a new local one, which is needed when a function must assign to a global name.
- A function can return multiple values by returning a tuple or a list, and the caller can unpack that result into several variables in one assignment.
- Recursion is a function calling itself on a smaller input, and it needs a base case that stops the recursion so it does not recurse forever and raise a RecursionError.
- A try block runs code that may fail and a matching except block handles a raised exception; an optional else runs when no exception occurred and a finally block always runs for cleanup whether or not an error happened.
- Common built-in exceptions include ValueError (right type but bad value, like int('abc')), ZeroDivisionError, TypeError, IndexError (list index out of range), and KeyError (missing dictionary key); you can trigger one yourself with the raise statement, and these classes form a hierarchy under BaseException.
PCEP exam tips
- The exam is not only multiple choice: it also uses drag-and-drop, gap-fill, and code-insertion item types, so practice actually reading and completing code rather than just recognizing an answer.
- Watch operator precedence and remember that ** is right-associative, so 2 ** 2 ** 3 is 2 ** 8; when in doubt, mentally add parentheses before evaluating an expression.
- Indexing is zero-based and slices exclude the stop bound, so list[2:5] gives three items at indices 2, 3, and 4; double-check off-by-one boundaries on every slicing and range() question.
- Know what is mutable versus immutable: lists and dictionaries can be changed in place, but tuples and strings cannot, and trying to assign to a string or tuple item raises a TypeError.
- Read the entire code snippet before answering, tracing variable values line by line, because loop counters, reassignments, and function return values often change the outcome near the end.
Study guide FAQ
What score do I need to pass PCEP?
You need 70 percent. The PCEP-30-02 exam has 30 questions, 40 minutes of exam time plus 5 minutes for the NDA/tutorial, so pace yourself carefully and leave a little review time.
Are there any prerequisites for the PCEP exam?
No. PCEP has no prerequisites and no required training. It is designed as a true entry-level credential for people with no prior programming experience, though basic computer literacy helps.
Does the exam test Python 2 or Python 3?
Python 3 only. All syntax, functions, and behavior on the exam follow Python 3, including print() as a function and true division with the / operator, so study and practice using a current Python 3 interpreter.
Is PCEP worth it, and does it lead to PCAP?
PCEP proves you understand core Python fundamentals and is a solid first credential for study or a resume. It is also the natural stepping stone to PCAP (Certified Associate in Python Programming), which builds on the same foundations and adds topics like modules, object-oriented programming, and more advanced data handling.