20+ practice questions focused on Functions, Tuples, Dictionaries and Exceptions — 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 Functions, Tuples, Dictionaries and Exceptions PracticeWhich THREE of the following dictionary methods return a view object that changes when the dictionary changes?
Explanation: C, and E because dict.keys(), dict.values(), and dict.items() all return view objects in Python 3. A view object provides a dynamic view of the dictionary's entries, meaning it reflects changes made to the dictionary. dict.get() returns a single value, not a view. dict.copy() returns a shallow copy, not a view. Therefore, there are three methods that return view objects.
A function is defined as: def func(*args, **kwargs): print(args, kwargs). It is called as func(1, 2, a=3, b=4). What is printed?
Explanation: The function uses `*args` to capture positional arguments into a tuple and `**kwargs` to capture keyword arguments into a dictionary. When called as `func(1, 2, a=3, b=4)`, `args` becomes `(1, 2)` and `kwargs` becomes `{'a': 3, 'b': 4}`, so `print(args, kwargs)` outputs `(1, 2) {'a': 3, 'b': 4}`. Option B is correct because it matches this exact output.
A developer wants to raise a ValueError with a custom message when a negative number is passed. Which code is correct?
Explanation: In Python, raising an exception with a custom message requires passing the message as an argument to the exception constructor: `raise ValueError("Negative input not allowed")`. This creates a ValueError instance with the specified message, which is the standard and only syntactically valid way to include a custom message in a raise statement.
Which THREE of the following are built-in exceptions in Python? (Select three.)
Explanation: StopIteration is a built-in exception in Python that is raised to signal the end of an iterator. It is automatically raised by the __next__() method when there are no further items to iterate over, and is caught by for loops internally to terminate iteration.
Which TWO of the following are valid dictionary methods? (Select two.)
Explanation: The `keys()` method returns a view object displaying all keys in a dictionary, and `values()` returns a view object of all values. Both are built-in dictionary methods in Python, making them valid for the PCEP exam.
+15 more Functions, Tuples, Dictionaries and Exceptions questions available
Practice all Functions, Tuples, Dictionaries and Exceptions questions1. Baseline your knowledge
Start with 10 questions to gauge your current understanding of Functions, Tuples, Dictionaries and Exceptions. 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
Functions, Tuples, Dictionaries and Exceptions 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. Functions, Tuples, Dictionaries and Exceptions is tested as part of the Certified Entry-Level Python Programmer PCEP blueprint. Practicing with targeted Functions, Tuples, Dictionaries and Exceptions 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 Functions, Tuples, Dictionaries and Exceptions 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 Functions, Tuples, Dictionaries and Exceptions practice session with instant scoring and detailed explanations.
Start Functions, Tuples, Dictionaries and Exceptions Practice →