Examers.io
ExamsOrganizationsHow it worksPricingHelp & FAQ
Python Institute logo

Python InstitutePCEP - Certified Entry-Level Python Programmer

Domain 2Objective 1

PCEP-30-02 2.1 Make Decisions and Branch the Flow with the If Instruction PCEP-30 Practice Questions (Page 1)

Part of the Control Flow Conditional Blocks and Loops domain, which accounts for 29% of the PCEP-30 exam. Python Institute does not publish an official question count, but from its 45-minute exam (~20–30 total, ~6–9 in this domain), expect 3–5 from this objective — we provide 8 practice questions to prepare you well beyond it. (estimate)

8questions here
2free pages
6concepts
29%of the exam

Questions 1–5

  1. 1foundation · easy

    What is the output of the following code? ```python a = 3 b = 5 if a > 2: print('first') if b > 4: print('second') ```

    Select an answer first
  2. 2foundation · easy

    What is the output of the following code? ```python x = 5 if x == 5: print('yes') print('done') ```

    Select an answer first
  3. 3foundation · easy

    What is the output of the following code? ```python num = 10 if num > 5: if num > 15: print('large') else: print('medium') else: print('small') ```

    Select an answer first
  4. 4foundation · easy

    What is the output of the following code? ```python color = 'red' if color == 'blue': print('sky') elif color == 'red': print('fire') elif color == 'green': print('grass') ```

    Select an answer first
  5. 5expert · hard

    A developer is debugging a function that categorizes a score. The code is: if score >= 90: result = 'A' elif score >= 80: result = 'B' elif score >= 70: result = 'C' else: result = 'F'. A test case with score = 85 returns 'B', which is correct. However, a test case with score = 95 returns 'A', also correct. The developer then changes the first condition to: if score > 90: result = 'A'. What happens to a score of exactly 90?

    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.