Examers.io
ExamsOrganizationsHow it worksPricingHelp & FAQ
Python Institute logo

Python InstitutePCEP - Certified Entry-Level Python Programmer

Domain 4Objective 1

PCEP-30-02 4.1 Decompose the Code Using Functions PCEP-30 Practice Questions (Page 1)

Part of the Functions and Exceptions domain, which accounts for 28% of the PCEP-30 exam. Python Institute does not publish an official question count, but from its 45-minute exam (~20–30 total, ~6–8 in this domain), expect 2–2 from this objective — we provide 19 practice questions to prepare you well beyond it. (estimate)

19questions here
4free pages
7concepts
28%of the exam

Questions 1–5

  1. 1expert · hard

    A developer is implementing a recursive function to calculate the sum of digits of a positive integer. They write: def digit_sum(n): if n < 10: return n return n % 10 + digit_sum(n // 10) What is the result of `digit_sum(1234)`?

    Select an answer first
  2. 2expert · hard

    A developer is writing a recursive function to reverse a string. They write: def reverse(s): if len(s) == 0: return s return reverse(s[1:]) + s[0] What is the result of `reverse('abc')`?

    Select an answer first
  3. 3foundation · easy

    Which keyword is used inside a generator function to produce a value and pause execution?

    Select an answer first
  4. 4foundation · easy

    What happens when you call a user-defined function with fewer arguments than it has parameters?

    Select an answer first
  5. 5expert · hard

    A developer needs to process a stream of log entries, but the stream is too large to fit in memory. They write a generator function that reads lines from a file and yields only lines containing 'ERROR'. They then iterate over it with a for loop. Which statement about this approach is true?

    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. “PCEP-30” is a trademark of its owner, used for identification only.