Examers.io
ExamsOrganizationsHow it worksPricingHelp & FAQ
Python Institute logo

Python InstitutePCEP - Certified Entry-Level Python Programmer

Domain 4Objective 2

PCEP-30-02 4.2 Organize Interaction Between the Function and Its Environment 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 31 practice questions to prepare you well beyond it. (estimate)

31questions here
7free pages
8concepts
28%of the exam

Questions 1–5

  1. 1expert · hard

    Consider the code: ```python x = 5 def f(): global x x = 10 def g(): print(x) g() f() print(x) ``` What is the output?

    Select an answer first
  2. 2expert · medium

    A function is defined as `def calculate(a, b, c=0, d=0):`. Which call is valid and assigns `a=1`, `b=2`, `c=3`, `d=4`?

    Select an answer first
  3. 3application · medium

    A developer writes: ```python count = 0 def reset(): count = 10 reset() print(count) ``` What is printed?

    Select an answer first
  4. 4foundation · easy

    What is the result of this code? ```python count = 0 def increment(): global count count += 1 increment() print(count) ```

    Select an answer first
  5. 5application · medium

    A developer wants a function to increment a global counter variable `count` by 1 each time it is called. Which function definition accomplishes this?

    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.