
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 8)
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 36–40
- 36
A developer wants to create a 3x3 matrix where each element is the product of its row index and column index. Which nested list comprehension builds this matrix?
Select an answer first - 37
A team maintains a list of employee records, each a tuple (name, age). They need a list of names of employees aged 30 or older. Which comprehension achieves this?
Select an answer first - 38
A data scientist has a list of lists, where each inner list contains numbers. They want to flatten this into a single list of all numbers that are positive. Which nested comprehension does this?
Select an answer first - 39
A developer needs to generate a list of all possible pairs (i, j) where i is from 1 to 3 and j is from 1 to 3, but only when i is less than j. Which comprehension produces this list?
Select an answer first - 40
A game developer wants to create a 2D grid of booleans where each cell is True if the sum of its row and column indices is even. Which nested comprehension builds this grid?
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.