Examers.io
ExamsOrganizationsHow it worksPricingHelp & FAQ
Python Institute logo

Python InstitutePCAP - Certified Associate Python Programmer

Domain 5Objective 1

PCAP-31-03 5.1 Build Complex Lists Using List Comprehensions PCAP-31 Practice Questions (Page 6)

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 43 practice questions to prepare you well beyond it. (estimate)

43questions here
9free pages
2concepts
22%of the exam

Questions 26–30

  1. 26expert · medium

    A data engineer needs to transpose a matrix represented as a list of lists. They want to use a nested comprehension. Which comprehension correctly transposes the matrix?

    Select an answer first
  2. 27expert · medium · select all that apply

    A developer is writing a list comprehension to generate a list of all even numbers from 0 to 20 that are also divisible by 4. Which of the following comprehensions correctly produce this list? Select all that apply.

    Select an answer first
  3. 28expert · medium

    A developer is working with a list of strings and needs to create a list of tuples, where each tuple contains the string and its length, but only for strings that contain the letter 'a'. Which comprehension achieves this?

    Select an answer first
  4. 29expert · medium

    A developer needs to generate a list of all prime numbers less than 50. They plan to use a list comprehension with a helper function is_prime(n). Which comprehension correctly uses the helper?

    Select an answer first
  5. 30expert · medium

    A developer is building a list of all possible coordinates (x, y) where x and y are integers from 0 to 5, but they want to exclude coordinates where x equals y. Which comprehension correctly does 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.