
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 4)
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 16–19
- 16
What is the result of the following code? def f(): return 5 print('unreachable') print(f())
Select an answer first - 17
A developer is debugging a function that is supposed to return a discount rate based on a customer tier. The function is: def get_discount(tier): if tier == 'gold': return 0.2 if tier == 'silver': return 0.1 A colleague calls `rate = get_discount('bronze')` and then uses `rate` in a calculation. What is the most likely problem?
Select an answer first - 18
What is the base case in a recursive function?
Select an answer first - 19
What is the purpose of the colon (:) at the end of a def statement in Python?
Select an answer first
Finished these 4 questions?
Review the revealed explanations, or continue through the curriculum.
No more pagesBack to PCEP-30
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.