
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 5)
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 21–25
- 21
A game developer wants to generate all possible coordinates (x, y) where x is from 0 to 4 and y is from 0 to 4, but only where x + y is even. They want a flat list of tuples. Which comprehension does this?
Select an answer first - 22
A financial analyst has a list of stock prices and wants to create a list of all prices that are above the average price. They want a one-liner. Which comprehension is correct?
Select an answer first - 23
A developer wants to transpose a 3x3 matrix represented as a list of lists. They want to use a nested list comprehension. Which code correctly transposes the matrix?
Select an answer first - 24
A system administrator has a list of IP addresses and wants to filter out those that are in a private range (e.g., starting with '192.168.'). They want a list comprehension. Which one is correct?
Select an answer first - 25
A data analyst needs to extract all even numbers from a list of integers, then square each of those even numbers. The result should be a new list. Which list comprehension correctly accomplishes 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.