
Python InstitutePCAP - Certified Associate Python Programmer
Domain 3Objective 3
PCAP-31-03 3.3 Employ Built-In String Methods PCAP-31 Practice Questions (Page 4)
Part of the Strings domain, which accounts for 18% of the PCAP-31 exam. Python Institute does not publish an official question count, but from its 65-minute exam (~25–45 total, ~5–8 in this domain), expect 2–3 from this objective — we provide 55 practice questions to prepare you well beyond it. (estimate)
55questions here
11free pages
8concepts
18%of the exam
Questions 16–20
- 16
A log-processing script reads a line like 'ERROR: disk full' and must extract the words after the colon, sort them alphabetically, and join them with a hyphen. The script currently has the line stored in a variable `line`. Which code snippet accomplishes this?
Select an answer first - 17
A list of names ['Alice', 'Bob', 'Charlie'] must be combined into a single string with names separated by '; '. Which code does this?
Select an answer first - 18
A script must find the position of the first space in a sentence, but only within the first 20 characters. If no space is found, it should return -1. Which code does this?
Select an answer first - 19
A list of strings ['banana', 'Apple', 'cherry'] must be sorted case-insensitively. Which code achieves this?
Select an answer first - 20
A developer is writing a function that extracts the substring between the first and last occurrence of a delimiter in a string. The function must raise a ValueError if the delimiter is missing. Which implementation is correct?
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.