Exam PCEP-30-02 Topic 3 Question 21 Discussion
Actual exam question for Python Institute's PCEP-30-02 exam
Question #: 21
Topic #: 3
Question #: 21
Topic #: 3
Assuming that the phone_dir dictionary contains name:number pairs, arrange the code boxes to create a valid line of code which adds Oliver Twist's phone number (5551122333) to the directory.


Suggested Answer:
phone_dir["Oliver Twist"] = ["5551122333"]
Explanation:

To correctly add Oliver Twist's phone number to the phone_dir dictionary, the code must follow this phone_dir["Oliver Twist"] = ["5551122333"] Now, let's match that with your code boxes and arrange them:
* phone_dir
* [
* "Oliver Twist"
* ]
* =
* [
* "5551122333"
* ]
Final Order:phone_dir # [ # "Oliver Twist" # ] # = # [ # "5551122333" # ]
Explanation:

To correctly add Oliver Twist's phone number to the phone_dir dictionary, the code must follow this phone_dir["Oliver Twist"] = ["5551122333"] Now, let's match that with your code boxes and arrange them:
* phone_dir
* [
* "Oliver Twist"
* ]
* =
* [
* "5551122333"
* ]
Final Order:phone_dir # [ # "Oliver Twist" # ] # = # [ # "5551122333" # ]
by Augus at Jul 25, 2026, 04:05 AM
0
0
0
10
Comments
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Report Comment
Commenting
You can sign-up / login (it's free).