Back to Certified Entry-Level Python Programmer PCEP questions

Scenario-based practice

Refer to the Exhibit Practice Questions

Practise Certified Entry-Level Python Programmer PCEP practice questions — original exam-style scenarios covering every exam domain, with detailed explanations, wrong-answer analysis, and common exam traps.

15
scenario questions
PCEP
exam code
Python Institute
vendor

Scenario guide

How to approach refer to the exhibit practice questions

Practise exhibit-style questions that ask you to read a topology, table, command output or diagram before choosing the best answer.

Quick answer

Exhibit-style questions test whether you can read a topology, command output, diagram or table before choosing the best answer.

How to extract the relevant detail from an exhibit.

How topology, command output or routing information affects the answer.

How to avoid answering from memory before reading the evidence.

How to map the exhibit back to the exam objective.

Related practice questions

Related PCEP topic practice pages

Scenario questions usually connect to one or more exam topics. Use these links to review the underlying concepts behind the scenario.

Practice set

Practice scenarios

Question 1mediummultiple choice
Full question →

Refer to the exhibit. What is the output?

Exhibit

def exception_test():
    try:
        x = 1 / 0
    except ZeroDivisionError:
        print('A')
    except:
        print('B')
    finally:
        print('C')

print('D')

exception_test()
Question 2mediummultiple choice
Full question →

Refer to the exhibit. What is the output?

Exhibit

def outer():
    x = 10
    def inner():
        nonlocal x
        x = 20
        print(x)
    inner()
    print(x)

outer()
Question 3mediummultiple choice
Full question →

Refer to the exhibit. What is the output of the code?

Exhibit

>>> x = 0
>>> while x < 5:
...     x += 1
...     if x == 3:
...         continue
...     print(x, end=' ')
1 2 4 5
Question 4hardmultiple choice
Full question →

Refer to the exhibit. What is the output of Line C?

Exhibit

def func(a, b, c=10, d=20):
    return a + b + c + d

print(func(1, 2, 3, 4))  # Line A
print(func(1, 2, 3))     # Line B
print(func(1, 2))        # Line C
Question 5mediummultiple choice
Full question →

Refer to the exhibit. If the user enters 5 and 3, what is the output?

Exhibit

x = input("Enter x: ")
y = input("Enter y: ")
print(x + y)
Question 6hardmultiple choice
Full question →

Refer to the exhibit. What is the printed value?

Exhibit

Refer to the exhibit.

```python
x = 5
y = 2
z = x ** y + x % y * 2
print(z)
```
Question 7hardmultiple choice
Full question →

Refer to the exhibit. What is the output when the code is executed?

Exhibit

funcs = []
for i in range(3):
    funcs.append(lambda: i)

for f in funcs:
    print(f(), end=' ')
Question 8hardmultiple choice
Read the full NAT/PAT explanation →

Based on the exhibit, where did the exception originate?

Exhibit

Refer to the exhibit.

Error log output:
Traceback (most recent call last):
  File "app.py", line 10, in <module>
    result = divide(10, 0)
  File "app.py", line 5, in divide
    return a / b
ZeroDivisionError: division by zero
Question 9hardmultiple choice
Full question →

Refer to the exhibit. What is the output?

Exhibit

def add_item(item, lst=[]):
    lst.append(item)
    return lst

print(add_item(1))
print(add_item(2, []))
print(add_item(3))
Question 10mediummultiple choice
Full question →

What is the output of the code in the exhibit?

Exhibit

Refer to the exhibit.

def process(data):
    return {item: len(item) for item in data}

print(process(['apple', 'banana', 'cherry']))
Question 11mediummultiple choice
Full question →

Refer to the exhibit. What is the output?

Exhibit

def func(a, b, *args, **kwargs):
    print(a, b, args, kwargs)

func(1, 2, 3, 4, x=5, y=6)
Question 12easymultiple choice
Full question →

Refer to the exhibit. What exception is raised when this code is executed?

Exhibit

def divide(a, b):
    return a / b

result = divide(10, 0)
Question 13hardmultiple choice
Full question →

Refer to the exhibit. What happens when this code is executed?

Exhibit

d = {'a':1, 'b':2}
for k, v in d.items():
    if k == 'a':
        del d[k]
print('done')
Question 14easymultiple choice
Full question →

Refer to the exhibit. What type of exception occurred?

Exhibit

Traceback (most recent call last):
  File "app.py", line 10, in <module>
    result = divide(10, 0)
  File "app.py", line 5, in divide
    return a / b
ZeroDivisionError: division by zero
Question 15hardmultiple choice
Full question →

Refer to the exhibit. What is printed?

Exhibit

x = 10
y = 5
if x > y:
    print("x greater")
elif x == y:
    print("equal")
else:
    print("y greater")

These PCEP practice questions are part of Courseiva's free Python Institute certification practice question bank. Courseiva provides original exam-style PCEP questions with detailed explanations, topic-based practice, mock exams, readiness tracking, and study analytics.