
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 3)
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 11–14
- 11
A developer is working with a large dataset and needs to create a list of all numbers that are both prime and palindromic. They have a helper function `is_prime(n)`. They want to use a list comprehension, but they are concerned about performance. Which approach is most efficient?
Select an answer first - 12
Select all that apply. A developer wants to create a list of all even numbers from 0 to 20 that are also divisible by 4. Which of the following list comprehensions achieve this?
Select an answer first - 13
A developer is trying to flatten a list of lists, but they also want to remove any duplicate values. They want to use a list comprehension, but they are aware that list comprehensions cannot directly remove duplicates. Which approach is the most efficient?
Select an answer first - 14
A developer is working with a list of strings and wants to create a list of all strings that contain the letter 'a' and have length greater than 3. They also want to ensure the code is case-insensitive. Which comprehension is correct?
Select an answer first
Finished these 4 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.