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.
A developer needs to create a decorator that accepts an argument, for example, `@retry(attempts=3)`. Which code structure correctly implements a decorator that takes its own arguments?
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?
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?
According to PEP 8, what is the recommended way to check if a list named `my_list` is empty?
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?
When designing a GUI with `tkinter`, what is the fundamental difference between the `grid` and `place` geometry managers?
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?
What is the primary motivation for using the `shelve` module over the `pickle` module for object persistence?
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`.
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.