
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 4)
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 16–20
- 16
A developer wants to create a 3x3 matrix where each cell contains the product of its row and column indices. They plan to use a nested list comprehension. Which code produces the correct matrix?
Select an answer first - 17
A developer needs to create a list of all possible combinations of two lists, but only where the sum of the two elements is greater than 10. They want to use a nested comprehension. Which code is correct?
Select an answer first - 18
A QA engineer needs to extract all positive numbers from a list of integers, but only if the number is also a perfect square. They want a one-liner. Which comprehension achieves this?
Select an answer first - 19
A data scientist has a list of lists, where each inner list contains strings. They want to create a single flat list of all strings that have length greater than 3. Which nested comprehension does this?
Select an answer first - 20
A developer is building a list of all prime numbers between 10 and 50. They want to use a list comprehension with a helper function `is_prime(n)`. Which comprehension 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.