
Python InstitutePCAP - Certified Associate Python Programmer
Domain 5Objective 5
PCAP-31-03 5.5 Perform Input/output Operations PCAP-31 Practice Questions (Page 1)
Part of the Miscellaneous (List Comprehensions, Lambdas, Closures, I/O) domain, which accounts for 22% of the PCAP-31 exam. Python Institute does not publish an official question count, but from its 65-minute exam (~25–45 total, ~6–10 in this domain), expect 1–2 from this objective — we provide 21 practice questions to prepare you well beyond it. (estimate)
21questions here
5free pages
8concepts
22%of the exam
Questions 1–5
- 1
A script must load all lines from a configuration file into a list for random access. The file is small (a few KB). The developer wants the simplest, most readable approach. Which code accomplishes this?
Select an answer first - 2
What is the purpose of the optional sizehint argument in readlines(sizehint)?
Select an answer first - 3
What is a key characteristic of a bytearray that makes it useful as an I/O buffer?
Select an answer first - 4
A developer is writing a report generator that must confirm how many characters were successfully written to a text file. The write() method returns a value. How should the developer capture and use this return value?
Select an answer first - 5
What does the .readline() method return when it reaches the end of a file?
Select an answer first
Finished these 5 questions?
Review the revealed explanations, or continue through the curriculum.
Free Basic Practice is a study aid with revealable answers — not a scored exam. Examers.io is independent and not affiliated with or endorsed by Python Institute. “PCAP-31” is a trademark of its owner, used for identification only.