Reinforce PCEP concepts with active-recall study cards covering all 4 blueprint domains. Each card shows the question on the front and the correct answer with a full explanation on the back.
Flashcards work through active recall — the process of retrieving information from memory rather than passively re-reading it. Research consistently shows that active recall produces stronger, longer-lasting memory than re-reading study guides. For PCEP preparation, this means flashcards are one of the highest-return study tools available.
Attempt recall first
Read the PCEP question on each card, pause, and attempt to formulate the answer in your own words before revealing. This retrieval attempt — even if wrong — dramatically strengthens memory compared to immediately reading the answer.
Review wrong cards again
When you get a card wrong, note it and add it back to your review pile. Spaced repetition — seeing difficult cards more frequently — is the mechanism that makes flashcard study far more efficient than linear reading.
Study by domain
Group your PCEP flashcard sessions by domain for the first 3–4 weeks. Master one domain before moving to the next. In the final week, shuffle all cards together to test cross-domain recall — which is what the real PCEP exam requires.
Short sessions beat marathon reviews
20–30 flashcard cards per session, done daily, produces better retention than a single 200-card marathon session. Five short daily sessions per week over 4 weeks gives you over 400 total card reviews — enough to reliably pass PCEP.
Sample cards from the PCEP flashcard bank. Read the question, think of the answer, then read the explanation below.
A developer writes a script that prompts the user for their age and stores it in a variable. Which code snippet correctly converts the input to an integer?
age = int(input("Enter age: "))
Option B is correct because it uses the `int()` function to convert the string returned by `input()` into an integer. The `input()` function always returns a string, so wrapping it with `int()` performs the type conversion needed for numeric operations.
A developer writes the following code: x = 5; y = 2; print(x // y). What is the output?
2
The floor division operator (//) in Python returns the largest integer less than or equal to the result of the division. Since 5 divided by 2 equals 2.5, the floor is 2, and the result is an integer (int) because both operands are integers. Therefore, the output is 2.
A developer writes a loop to sum numbers from 1 to 10. The code outputs 55, but the expected sum is 55. However, the loop uses a range that includes 0. Which range should be used to achieve the correct sum?
range(1,11)
Option B (range(1,11)) is correct because range(start, stop) generates numbers from start inclusive to stop exclusive. To sum numbers 1 through 10, the range must start at 1 and end at 11 (so 10 is included). The loop that used range(0,11) included 0, but since adding 0 does not change the sum, the output was still 55 — however, the question asks for the range that achieves the correct sum without including unnecessary values.
A developer writes a function to calculate the average of a list of numbers, but the function sometimes returns a wrong result when the list contains non-numeric values. What is the best way to handle this?
Check that all items are numeric before calculation, and raise TypeError otherwise.
Option D is correct because it explicitly validates that all items are numeric before performing the calculation, raising a TypeError if any non-numeric value is found. This follows Python's principle of explicit error handling and ensures the function's contract is clear: it only works with numeric data. Returning None (A) or silently ignoring values (B) can lead to subtle bugs, while converting to strings (C) would produce a concatenated string, not an average.
What is the data type of z?
float
The correct answer is float because in Python, the / operator always performs true division and returns a float, regardless of the operands. This is a fundamental concept tested in the PCEP exam to distinguish between / and //.
A developer runs the script and enters 'Alice' and '25'. What does it print?
Alice is 25 years old.
The correct answer is D because the input() function returns strings. When print() is called with multiple arguments separated by commas, it inserts spaces between them. Since the age input '25' is not converted to a number, it is printed as a string without a decimal point. Thus, the output is 'Alice is 25 years old.'
A developer writes the following code snippet: for i in range(3): for j in range(2): if i == j: break else: print(i, 'outer') What is the output?
2 outer
The code uses nested loops with a `for-else` construct. The `else` block executes only if the inner loop completes without a `break`. When `i == j`, the `break` exits the inner loop, skipping the `else`. For `i=0`, `j=0` triggers `break`; for `i=1`, `j=1` triggers `break`; for `i=2`, the inner loop runs `j=0,1` without any `i==j` (since 2 != 0 and 2 != 1), so the `else` executes, printing `2 outer`. Thus, only option B is correct.
Given the exhibit, what does the code print?
3.0
The code likely performs floor division with at least one float operand (e.g., print(7.0 // 2) or print(7 // 2.0)). Floor division // returns the largest integer less than or equal to the quotient, but if either operand is a float, the result is a float. Since 7.0 // 2 = 3.0, the output is 3.0. If both operands were integers, the result would be the integer 3, not 3.0. Thus option A (3.0) is correct.
Refer to the exhibit. What is the output?
[1] [2] [1, 3]
Option D is correct because the function uses a mutable default argument `lst=[]`. On the first call, `append_to_list(1)` uses the default list and appends 1, returning `[1]`. On the second call, `append_to_list(2, [])` passes an explicit empty list, so it appends 2 to that new list, returning `[2]`. On the third call, `append_to_list(3)` uses the default list again, which now contains `[1]` from the first call, so appending 3 yields `[1, 3]`. Thus the output is `[1] [2] [1,3]` printed on separate lines.
What does the following code print? text = 'Hello World'; print(text.replace('o', '0').upper())
HELL0 W0RLD
The string 'Hello World' is first operated on by replace('o', '0') which replaces all occurrences of 'o' with '0', resulting in 'Hell0 W0rld'. Then .upper() converts all characters to uppercase, yielding 'HELL0 W0RLD'. Therefore, option C is correct. Option A is 'hell0 w0rld' which would require .lower() after replace. Option B is 'HELLO WORLD' which does not apply the replacement. Option D is 'Hell0 W0rld' which is only the result after replace but without .upper().
A program calculates the total price including tax: total = price * 1.08. The variable price is assigned as price = 100.0. After execution, total is 108.0. The developer then changes price to 100. What will total be?
108.0
Option C is correct because in Python, multiplying an integer (100) by a float (1.08) results in a float (108.0). The expression `price * 1.08` performs implicit type coercion to float, so even when `price` is changed from 100.0 to 100, the result remains 108.0, not 108.
Which of the following is the most efficient (Pythonic) way to create a list of squares for numbers 0 through 9?
squares = [i*i for i in range(10)]
Option A uses a list comprehension, which is the most Pythonic and efficient way to create a list because it combines iteration and list construction in a single, readable expression. It avoids the overhead of repeated method calls (like `append`) and is faster than `map` with a lambda due to reduced function call overhead.
Which of the following is the correct way to define a function that takes no arguments and returns the value 42?
def f() return 42 / def f(): return 42
Both option B and option D use the correct Python syntax for defining a function with no arguments that returns 42: `def f(): return 42`. Option B is incorrectly marked as wrong in the original set, but its text is identical to option D, making it correct as well.
What is the output of: print(2 ** 3 ** 2)?
512
In Python, the exponentiation operator ** is right-associative, meaning that `2 ** 3 ** 2` is evaluated as `2 ** (3 ** 2)`, not `(2 ** 3) ** 2`. First, `3 ** 2` equals 9, then `2 ** 9` equals 512. Thus, the correct output is 512.
Given the code: a = [1, 2, 3]; b = a; b.append(4). What is the value of a?
[1, 2, 3, 4]
Option A is correct because in Python, variables hold references to objects, not copies. When `b = a` is executed, both `a` and `b` point to the same list object in memory. The `append()` method modifies the list in-place, so the change is visible through both references. Thus, `a` becomes `[1, 2, 3, 4]`.
A user enters 'Alice' for name and '30' for age. What is the output?
Alice is 30 years old.
Option A is correct because the code `print(name + ' is ' + age + ' years old.')` concatenates the string `'Alice '`, the string `' is '`, the string `'30'`, and the string `' years old.'` using the `+` operator. In Python, the `+` operator performs string concatenation when both operands are strings, and since `input()` always returns a string, both `name` and `age` are strings, so no type error occurs. The output is exactly `Alice is 30 years old.` including the period at the end.
A beginner writes: x = '10'; y = 20; print(x + y). What happens?
Raises TypeError
Option A is correct because Python's type system does not allow implicit concatenation of a string and an integer. The variable `x` is a string (`'10'`), and `y` is an integer (`20`). The `+` operator with these types triggers a `TypeError: unsupported operand type(s) for +: 'int' and 'str'` (or vice versa), as Python refuses to guess the programmer's intent.
What is the output?
4
The correct answer is 4 because the code (likely involving range(4) and len()) outputs 4. In Python, range(4) generates 4 numbers (0, 1, 2, 3), and len() returns the count, which is 4.
A developer needs to swap the values of two variables a and b without using a temporary variable. Which single line of code correctly performs the swap?
a, b = b, a
Option B is correct because Python supports tuple unpacking, which allows swapping the values of two variables in a single line without a temporary variable. The expression `a, b = b, a` evaluates the right-hand side tuple `(b, a)` first, then assigns the values to `a` and `b` respectively, effectively swapping them. Option A fails because after `a = b`, the original value of `a` is lost, so `b = a` assigns the same value to both. Option C (XOR swap) works but requires three statements, not a single line. Option D (arithmetic swap) also works but requires three statements and may cause overflow in other languages, though Python handles big integers; still, it is not a single line.
A developer wants to read a floating-point number from user input and compute its square. Which code snippet correctly accomplishes this?
num = float(input()); result = num ** 2
Option B is correct because it uses `float(input())` to convert the user's input (which is always a string) into a floating-point number, and then computes the square using the exponentiation operator `**`. This ensures that decimal values are handled correctly, which is required for computing the square of a floating-point number.
A Python script contains the following line: x = 5. Later in the script, the programmer wants to check if x is an integer. Which of the following is the BEST way to perform this check?
if isinstance(x, int):
Option A is correct because `isinstance(x, int)` is the recommended way to check if a variable is an instance of a specific class in Python. It handles inheritance correctly (e.g., if `x` were a subclass of `int`) and is more robust than directly comparing types with `type()`. This aligns with Python's duck typing philosophy and is the standard approach in professional code.
A Python program is designed to process user input and store results in a dictionary. The code uses the statement: my_dict[user_key] = value. Under which condition will this statement raise a TypeError?
If the key is a list.
Option D is correct because dictionary keys must be immutable (hashable) types. A list is mutable and therefore unhashable, so using it as a key in a dictionary assignment raises a TypeError. The statement `my_dict[user_key] = value` will fail at runtime if `user_key` is a list.
The PCEP flashcard bank covers all 4 official blueprint domains published by Python Institute. Cards are distributed proportionally, so domains with higher exam weight have more cards.
Domain Coverage
Computer Programming and Python Fundamentals
Data Types, Variables, Basic I/O and Operators
Control Flow, Loops, Lists and Logic
Functions, Tuples, Dictionaries and Exceptions
Both flashcards and practice questions are evidence-based study tools. The difference is in what they train:
Flashcards — concept retention
Best for memorising definitions, acronyms, protocol behaviours, command syntax, and conceptual distinctions. Use flashcards to build the foundational vocabulary that PCEP questions assume you know.
Best in: weeks 1–3
Practice tests — application
Best for applying concepts to realistic scenarios, eliminating distractors, and building exam stamina.PCEP questions test scenario reasoning — not just recall — so practice tests are essential.
Best in: weeks 3–6
The most effective PCEP study plan combines both: use flashcards for the first 2–3 weeks to build conceptual foundations, then shift to practice tests and mock exams in the final 2–3 weeks to apply and benchmark that knowledge. Most candidates who pass on their first attempt use both tools.
Yes. Courseiva provides free PCEP flashcards across all official exam domains. Every card includes the correct answer and a full explanation of why it is right and why the distractors are wrong. The platform also includes topic-based practice, mock exams, and readiness tracking — no account required.
Courseiva has 520+ original PCEP flashcards across all 4 exam blueprint domains. New cards are added regularly as the question bank grows. All cards are written by certified engineers against the official Python Institute exam objectives.
Courseiva flashcards are purpose-built for IT certification exams. Unlike generic flashcard platforms where content quality varies, every Courseiva card is mapped to the official PCEP exam blueprint, written by engineers who hold the certification, and includes a full explanation of the correct answer and why the distractors are wrong. This explanation quality is what separates genuine learning from rote memorisation.
Courseiva is a web platform — an internet connection is required. For offline study, we recommend creating free Courseiva account, using the platform in your browser, and using your device's offline capabilities if your browser supports offline web apps.
Save your results, see which domains need more work, and get spaced repetition recommendations — all free.
Sign Up FreeFree forever · Every certification included