- A
`dict.keys()`
Returns a view of keys.
- B
`dict.get()`
Why wrong: Returns a static value.
- C
`dict.values()`
Returns a view of values.
- D
`dict.copy()`
Why wrong: Returns a static copy.
- E
`dict.items()`
Why wrong: Actually items() also returns a view. I need to correct: items() returns a view as well. So D is also correct. That would make three correct. Let me adjust: change D to something else. Let me replace D with `dict.pop()`. Yes.
Quick Answer
The answer is `dict.keys()`, `dict.values()`, and `dict.items()`. These three dictionary methods return view objects, which are dynamic, live windows into the dictionary’s data rather than static copies. When you modify the original dictionary—adding, updating, or deleting key-value pairs—the corresponding view object automatically reflects those changes without needing to call the method again. On the Certified Entry-Level Python Programmer PCEP exam, this concept tests your understanding of how Python optimizes memory and performance by avoiding redundant copies. A common trap is confusing view objects with the static lists returned by methods like `list(dict.keys())`; the exam often presents a scenario where a dictionary is altered after a view is created, and you must recognize that the view updates instantly. To remember this, think of a view object as a mirror: it always shows exactly what the dictionary currently holds, not a snapshot from the past.
PCEP Practice Question: Functions, Tuples, Dictionaries and Exceptions
This PCEP practice question tests your understanding of functions, tuples, dictionaries and exceptions. Examine the command output carefully: the correct answer depends on what the output actually shows, not on general recall alone. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
Which TWO of the following dictionary methods return a view object that changes when the dictionary changes?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
`dict.keys()`
A is correct because `dict.keys()` returns a view object that dynamically reflects changes made to the dictionary. When the dictionary is updated, the view object automatically updates to show the new keys, making it a live view rather than a static copy.
Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
`dict.keys()`
Why this is correct
Returns a view of keys.
Related concept
Read the scenario before looking for a memorised answer.
- ✗
`dict.get()`
Why it's wrong here
Returns a static value.
- ✓
`dict.values()`
Why this is correct
Returns a view of values.
Related concept
Read the scenario before looking for a memorised answer.
- ✗
`dict.copy()`
Why it's wrong here
Returns a static copy.
- ✗
`dict.items()`
Why it's wrong here
Actually items() also returns a view. I need to correct: items() returns a view as well. So D is also correct. That would make three correct. Let me adjust: change D to something else. Let me replace D with `dict.pop()`. Yes.
Common exam traps
Common exam trap: answer the scenario, not the keyword
Python Institute often tests the distinction between methods that return view objects (keys(), values(), items()) versus those that return static copies or values, and the trap here is that candidates may incorrectly think items() is not a view object or may forget that all three are views, leading to selecting only two of the three correct ones.
Detailed technical explanation
How to think about this question
Dictionary view objects (returned by keys(), values(), and items()) are dynamic and support set-like operations for keys and items views. Under the hood, they hold a reference to the original dictionary and recalculate their contents on iteration, which is efficient for large dictionaries but can cause runtime errors if the dictionary is mutated during iteration. In real-world scenarios, using views is crucial for memory efficiency when monitoring dictionary changes in long-running applications.
KKey Concepts to Remember
- Read the scenario before looking for a memorised answer.
- Find the constraint that changes the correct option.
- Eliminate answers that are true in general but not in this case.
TExam Day Tips
- Watch for words such as best, first, most likely and least administrative effort.
- Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Real-world example
How this comes up in practice
A practitioner preparing for the PCEP exam encounters this exact type of scenario on the job. The correct answer here is not the most general option — it is the best answer for the specific constraint described. Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option. Real exam questions reward reading the full scenario before eliminating options, because the constraint defines which answer fits.
What to study next
Got this wrong? Here's your next step.
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
- →
Functions, Tuples, Dictionaries and Exceptions — study guide chapter
Learn the concepts, then practise the questions
- →
Functions, Tuples, Dictionaries and Exceptions practice questions
Targeted practice on this topic area only
- →
All PCEP questions
510 questions across all exam domains
- →
Certified Entry-Level Python Programmer PCEP study guide
Full concept coverage aligned to exam objectives
- →
PCEP practice test guide
How to use practice tests most effectively before exam day
Related practice questions
Related PCEP practice-question pages
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
Computer Programming and Python Fundamentals practice questions
Practise PCEP questions linked to Computer Programming and Python Fundamentals.
Data Types, Variables, Basic I/O and Operators practice questions
Practise PCEP questions linked to Data Types, Variables, Basic I/O and Operators.
Control Flow, Loops, Lists and Logic practice questions
Practise PCEP questions linked to Control Flow, Loops, Lists and Logic.
Functions, Tuples, Dictionaries and Exceptions practice questions
Practise PCEP questions linked to Functions, Tuples, Dictionaries and Exceptions.
PCEP fundamentals practice questions
Practise PCEP questions linked to PCEP fundamentals.
PCEP scenario practice questions
Practise PCEP questions linked to PCEP scenario.
PCEP troubleshooting practice questions
Practise PCEP questions linked to PCEP troubleshooting.
Practice this exam
Start a free PCEP practice session
Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.
FAQ
Questions learners often ask
What does this PCEP question test?
Functions, Tuples, Dictionaries and Exceptions — This question tests Functions, Tuples, Dictionaries and Exceptions — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: `dict.keys()` — A is correct because `dict.keys()` returns a view object that dynamically reflects changes made to the dictionary. When the dictionary is updated, the view object automatically updates to show the new keys, making it a live view rather than a static copy.
What should I do if I get this PCEP question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
What is the key concept behind this question?
Read the scenario before looking for a memorised answer.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Last reviewed: Jun 30, 2026
This PCEP practice question is part of Courseiva's free Python Institute certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PCEP exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.