20+ practice questions focused on Control Flow, Loops, Lists and Logic — one of the most tested topics on the Certified Entry-Level Python Programmer PCEP exam. Each question includes a detailed explanation so you learn why the right answer is correct.
Start Control Flow, Loops, Lists and Logic PracticeA 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?
Explanation: 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 programmer needs to iterate over a list of strings and print each string in uppercase. Which loop correctly accomplishes this?
Explanation: Option A is correct because it uses a for loop with enumerate to iterate over the list, and calls the string method upper() (with parentheses) to convert each item to uppercase before printing. This ensures each string is properly transformed and output.
A programmer writes code that uses a while loop to process user input until the user types 'exit'. The code currently prints 'Done' after the loop, but it never exits. What is the most likely cause?
Explanation: Option D is correct because if the variable controlling the loop (e.g., the user's input) is never updated inside the while loop, the loop condition will never become false, causing an infinite loop. In this scenario, the programmer likely reads input once before the loop but does not call input() again inside the loop to update the variable, so the loop never sees the 'exit' value.
A list of numbers is defined as nums = [1, 2, 3, 4, 5]. Which expression returns the last element?
Explanation: Option B is correct because Python uses zero-based indexing, so the first element is at index 0 and the last element is at index -1. Negative indices count from the end of the list, so nums[-1] directly accesses the last element (5) without needing to know the list length.
A list contains strings and numbers: items = ['apple', 10, 'banana', 20]. A programmer wants to create a new list that contains only the strings. Which approach is correct?
Explanation: Option C is correct because `type(item) == str` directly compares the type of each item to the `str` type object, which returns `True` for strings and `False` for numbers. This is a valid and explicit way to filter the list comprehension to only include string elements.
+15 more Control Flow, Loops, Lists and Logic questions available
Practice all Control Flow, Loops, Lists and Logic questions1. Baseline your knowledge
Start with 10 questions to gauge your current understanding of Control Flow, Loops, Lists and Logic. This tells you whether you need a concept refresher or just practice.
2. Review every explanation
For each question — right or wrong — read the full explanation. Understanding why an answer is correct is more valuable than knowing the answer itself.
3. Focus on exam traps
Control Flow, Loops, Lists and Logic questions on the PCEP frequently use trap wording. Look for subtle differences in answers that test your precision, not just general knowledge.
4. Reach 80% consistently
Do repeated sessions until you score 80%+ three times in a row. Then move to mixed-mode practice to test cross-topic recall under realistic conditions.
The exact number varies per candidate. Control Flow, Loops, Lists and Logic is tested as part of the Certified Entry-Level Python Programmer PCEP blueprint. Practicing with targeted Control Flow, Loops, Lists and Logic questions ensures you can handle any format or difficulty that appears.
Yes. Courseiva provides free PCEP practice questions across all exam topics and domains. The platform includes topic-based practice, mock exams, missed-question review, bookmarked questions, and readiness tracking — no account required.
Difficulty is subjective, but Control Flow, Loops, Lists and Logic is a high-priority exam concept tested in multiple ways — direct recall, scenario analysis, and command-output interpretation. Consistent practice is the best way to build confidence.
Launch a full Control Flow, Loops, Lists and Logic practice session with instant scoring and detailed explanations.
Start Control Flow, Loops, Lists and Logic Practice →