
Python InstitutePCAP - Certified Associate Python Programmer
Domain 5Objective 4
PCAP-31-03 5.4 Understand Basic Input/output Terminology 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 10 practice questions to prepare you well beyond it. (estimate)
10questions here
2free pages
4concepts
22%of the exam
Questions 1–5
- 1
A script is designed to be run from the command line, and the developer wants to allow the user to redirect the output to a file using shell redirection (e.g., `python script.py > output.txt`). Which stream should the script write its main results to?
Select an answer first - 2
A script writes diagnostic messages to a log file and also prints progress updates to the console. The developer wants progress updates to appear immediately on the user's screen, while error messages should be sent to a separate stream that can be redirected independently. Which approach correctly uses Python's standard streams?
Select an answer first - 3
A developer is debugging a script that opens a file and reads it. The script fails with an error, and the developer wants to inspect the file object to see its mode and name. Which attribute of the file object should be examined?
Select an answer first - 4
In Python, which standard stream is used for error messages and diagnostic output?
Select an answer first - 5
A script is designed to be run in a CI/CD pipeline. The developer wants to ensure that progress messages are shown in the console but are not captured in the pipeline's output artifact. Which stream should be used for progress messages?
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.