Exam PCEP-30-02 Topic 3 Question 21 Discussion

Actual exam question for Python Institute's PCEP-30-02 exam
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" # ]

by Augus at Jul 25, 2026, 04:05 AM

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Nick name: Submit Cancel
A voting comment increases the vote count for the chosen answer by one.

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.

0
0
0
10