
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 2)
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 6–10
- 6
A developer writes a generator function that yields the squares of numbers from 1 to n. They call it with `squares = square_gen(3)` and then run `print(next(squares))` twice. What is printed?
Select an answer first - 7
A function is defined as `def greet(name, greeting):` and the developer wants to call it with the name 'Alice' and the greeting 'Hello'. Which call is correct?
Select an answer first - 8
A script has the following code: def add(a, b): return a + b result = add(3, 4) print(result) What is printed?
Select an answer first - 9
What does the return statement do in a Python function?
Select an answer first - 10
What is the value of the variable result after executing the following code? def add(a, b): return a + b result = add(2, 3)
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.