PCPP1 · domain
Library Modules
Practise Python Institute Certified Professional in Python Programming 1 (PCPP1, PCPP-32-101) (PCPP1) Library Modules practice questions — original exam-style scenarios with answer choices, explanations, and analysis of common mistakes.
Focused practice
Practice Library Modules questions
Scored sessions drawing only from this domain — pick a length below.
Start 20-question practice test →What this domain covers
What to know about Library Modules
Library Modules questions test whether you can apply the concept in context, not just recognise a definition.
How the topic appears in realistic exam-style scenarios.
Which detail in the question changes the correct answer.
How to eliminate plausible but wrong options.
How to connect the question back to the wider exam objective.
Watch out for
Common Library Modules exam traps
- ▸Answering from memory before reading the full scenario.
- ▸Missing a constraint such as cost, availability, security, scope or command context.
- ▸Choosing a broad answer when the question asks for the most specific fix.
- ▸Ignoring why the wrong options are tempting.
Question index
All Library Modules questions (38)
Click any question to see the full explanation, or start a practice session above.
What is the purpose of the logging.StreamHandler?
Easy2Which TWO of the following are true about the logging module?
Medium3When using configparser, how do you retrieve a value as a boolean?
Easy4You are logging events with custom levels. How do you add a custom level 'TRACE' (value 5) to the logging module?
Hard5When parsing an XML document using xml.etree.ElementTree, you want to find all 'item' tags that are immediate children of the root element. Which method is most efficient for this?
Medium6In xml.etree.ElementTree, what is the difference between find() and findall() when used with XPath support?
Hard7In the context of the CSV module, what is a 'dialect'?
Easy8When using configparser, what happens if you attempt to read a configuration file that does not exist using the read() method?
Medium9Which TWO of the following are valid ways to define a configuration option in configparser?
Medium10You are writing to a CSV file. If your data contains the delimiter character itself (e.g., a comma in a text field), what does the csv module do by default?
Medium11When parsing XML with ElementTree, how do you retrieve the text content of an element?
Easy12Which THREE of the following are valid parameters for the csv.writer constructor?
Medium13Which TWO of the following are valid ways to read sections in a configparser object?
Easy14Which THREE of the following are components of the logging module?
Easy15You are using configparser and want to access a value that might not exist, but provide a default value if it is missing. Which method is most appropriate?
Medium16When executing a SQL query with parameters in sqlite3, why should you use placeholders (e.g., ?) rather than f-strings?
Medium17Which class in xml.etree.ElementTree should you use to parse an XML file from a file object?
Easy18What is the result of using '?' as a placeholder in sqlite3 for a parameter that is a Python list?
Easy19Which THREE of the following are valid methods of the xml.etree.ElementTree.Element class?
Hard20You are using the sqlite3 module to manage a database. You need to ensure that database changes are permanently saved even if your script terminates unexpectedly. Which method should you call after an INSERT operation?
Medium21Which TWO of the following are valid ways to create a connection in the sqlite3 module?
Easy22In the csv module, how do you specify that the CSV file uses a semicolon (;) as a delimiter?
Medium23Which logging configuration would effectively suppress all log messages?
Medium24Which method in the xml.dom.minidom module is used to retrieve the value of a specific attribute of an element?
Medium25You want to execute multiple SQL statements at once in sqlite3. Which method should you use?
Medium26Which THREE of the following are valid states/modes for the csv.QUOTE_* constants?
Medium27When using configparser, how do you handle multiline values?
Hard28When using sqlite3.Row, what is the primary benefit over using a standard tuple?
Easy29You are configuring a logging FileHandler. What does the 'mode' parameter control?
Medium30You want to retrieve a list of all section names from a ConfigParser object. How do you do this?
Hard31Which TWO of the following are required to successfully write a row to a CSV file?
Medium32You are using configparser.ConfigParser to read a configuration file. You have a file where option names are case-sensitive. How do you ensure the parser respects this casing?
Hard33You are configuring logging using a dictConfig. You want to send logs to a RotatingFileHandler. Which key must you define in the 'handlers' section?
Hard34You need to configure the logging module to capture logs from multiple modules while ensuring that logs from third-party libraries (e.g., 'urllib3') are only captured at the WARNING level. How do you set this?
Medium35Which THREE of the following are valid logging levels?
Easy36You are processing a CSV file using csv.DictReader. If your input file lacks a header row, how do you provide the field names?
Medium37You are using sqlite3 and need to enforce foreign key constraints. How do you enable them?
Medium38Which TWO of the following are true about the sqlite3.Cursor object?
HardOther domains
All PCPP1 exam domains
Frequently asked questions
- What does the Library Modules domain cover on the PCPP1 exam?
- Library Modules questions test whether you can apply the concept in context, not just recognise a definition.
- How many questions are in this domain?
- This page lists all 38 Library Modules questions in the PCPP1 question bank. The actual exam draws from this domain proportionally to its weighting in the official exam blueprint.
- What is the best way to practise this domain?
- Start with a short focused session (10 questions) to identify gaps, then work through explanations. Repeat with a longer session once the weak areas feel solid.
- Can I practise only Library Modules questions?
- Yes — the session launcher on this page filters questions to this domain only. Choose any session length for inline explanations and scoring.