PCEP Study Guide 2026
Everything you need to pass the PCEP exam in one place: the exam format, every topic to study, real practice questions with explanations, flashcards, and full-length practice tests. Free, no sign-up needed.
📋 PCEP Exam Format at a Glance
📚 PCEP Topics to Study (61)
✍️ Sample PCEP Questions & Answers
1. What is the output of the following? x = 5 def change(): x = 10 change() print(x)
Without the `global` keyword, `x = 10` inside `change()` creates a local variable, leaving the global `x` unchanged at 5.
2. What is the output of `print('Python', 3, sep='.')`?
sep='.' is placed between the string 'Python' and the integer 3 after it is converted to its string representation.
3. Which of the following will raise an `IndexError`?
Accessing `my_list[5]` on a list with only 2 elements raises `IndexError` because the index is out of the valid range.
4. What is the output of: ```python for i in range(3): pass print(i) ```
The loop variable `i` retains its last value after the loop ends, which is 2 for `range(3)`.
5. What is the output of `[0] * 4`?
Multiplying a list by an integer repeats its elements that many times.
6. What is the result of: ``` print('A', end='B') print('C') ```
The first print ends with 'B' instead of '\n', so 'C' from the second print immediately follows, producing 'ABC' on one line.