
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 3)
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 11–15
- 11
A developer is testing a recursive function that computes the nth Fibonacci number: def fib(n): if n <= 1: return n return fib(n-1) + fib(n-2) What is the result of `fib(3)`?
Select an answer first - 12
What does a function return if it has no return statement?
Select an answer first - 13
A developer writes the following generator function: def evens(limit): for i in range(limit): if i % 2 == 0: yield i They then run `for x in evens(6): print(x)`. What is the output?
Select an answer first - 14
Given the function definition def add(a, b): return a + b, which call is correct?
Select an answer first - 15
A script defines a function `get_total(prices)` that returns the sum of a list of prices. The developer calls it with `total = get_total([10, 20, 30])`. What will the variable `total` contain?
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.