Examers.io
ExamsOrganizationsHow it worksPricingHelp & FAQ
Python Institute logo

Python InstitutePCAP - Certified Associate Python Programmer

Domain 3Objective 3

PCAP-31-03 3.3 Employ Built-In String Methods PCAP-31 Practice Questions (Page 9)

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 41–45

  1. 41expert · hard

    You are building a search function that must find all occurrences of a substring within a string, but you want to avoid using a loop with index() because it raises exceptions. Which approach is most efficient and safe?

    Select an answer first
  2. 42expert · hard

    You have a string that contains multiple occurrences of a delimiter, and you need to extract the text after the last delimiter. You also need to handle the case where the delimiter is not present, returning the original string. Which code snippet is most robust?

    Select an answer first
  3. 43expert · hard

    You have a list of strings: ['banana', 'Apple', 'cherry']. You need to sort them case-insensitively and then join them with a hyphen. Which code snippet achieves this?

    Select an answer first
  4. 44expert · hard · select all that apply

    You are validating a password policy. The password must contain at least one uppercase letter, one lowercase letter, and one digit. It may contain spaces, but leading/trailing spaces should be ignored. Which of the following code snippets correctly perform this validation? (Select all that apply.)

    Select an answer first
  5. 45expert · medium

    You have a list of words: words = ['apple', 'banana', 'cherry']. You need to create a comma-separated string, but you want to exclude any word that contains the letter 'a'. Which code snippet achieves this?

    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.