Free PCPP-32-101 sample questions

Real questions from the PCPP1 – Certified Professional Python Programmer Level 1 practice bank, with the correct answer and an explanation for each one. No junk, no filler.

Try them in the simulator Same questions, with study, timed and flashcard modes.

Showing 10 of 20 free sample questions.

Question 1Choose one

You are reviewing Python code and find the following line inside an `except` block: `raise ConnectionError("Failed to connect to database") from exc` What is the primary purpose of the `from exc` syntax in this context?

Question 2Choose one

A developer is writing a REST client using the `requests` library to fetch user data from an API endpoint. The API requires a custom header `X-API-Key` for authentication. Which code snippet correctly sends a GET request to `https://api.example.com/users/123` with the required custom header?

Question 3Choose one

According to PEP 8, what is the recommended way to check if a list named `my_list` is empty?

Question 4Choose one

A developer is using the `csv` module to write data to a file. They want to ensure that each row is written from a dictionary, where the dictionary keys correspond to the header row. Which combination of `csv` module components should be used to open the file and write the rows?

Question 5Choose one

When designing a GUI with `tkinter`, what is the fundamental difference between the `grid` and `place` geometry managers?

Question 6Choose one

A developer needs to create a custom class that behaves like a dictionary but logs a message every time a key is accessed. Which magic method must be implemented to intercept key retrieval?

Question 7Choose one

What is the primary motivation for using the `shelve` module over the `pickle` module for object persistence?

Question 8Choose one

True or False: In Python's `socket` module, TCP sockets are created using `socket.SOCK_DGRAM` and UDP sockets are created using `socket.SOCK_STREAM`.

Question 9Choose one

An application uses the `logging` module to record events. The requirement is to have a rotating log file that creates a new file once the current one reaches 1MB, keeping a backup of the last 5 log files. Which handler from the `logging.handlers` module is most appropriate for this task?

Question 10Choose 2

A developer is building a Tkinter application and needs to retrieve the text currently entered in an `Entry` widget. If the `Entry` widget is associated with a `tk.StringVar` named `entry_var`, which two of the following methods are valid ways to get the widget's current text content? (Select TWO)

10 more free samples are waiting

Create a free account to unlock the whole PCPP-32-101 sample bank, or get full access to all 218 practice questions in the simulator.

Create account