Courseiva
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 func(a, b, *args, **kwargs):
    print(a, b, args, kwargs)

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

Refer to the exhibit. What type of error occurred, and which line caused it?

Exhibit

Refer to the exhibit.

Error output from a Python script:
Traceback (most recent call last):
  File "script.py", line 3, in <module>
    result = 10 / 0
ZeroDivisionError: division by zero
Question 3hardmultiple choice
Full question →

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

Exhibit

>>> my_list = [1, 2, 3, 4, 5]
>>> for i in range(len(my_list)):
...     if my_list[i] % 2 == 0:
...         my_list[i] = my_list[i] * 2
...     else:
...         my_list[i] = my_list[i] + 1
>>> print(my_list)
Question 4mediummultiple choice
Full question →

What is the output of the code in the exhibit?

Exhibit

Refer to the exhibit.

x = 10
if x > 5:
    print('Greater')
else:
    print('Less or equal')

Based on the exhibit, which expression returns 2.5 in Python?

Exhibit

Refer to the exhibit.
Command output:
>>> 5 // 2
2
>>> 5 % 2
1
>>> 5 / 2
2.5

Refer to the exhibit. A beginner Python programmer executes the code and gets an error. What is the most likely cause?

Exhibit

>>> x = 10
>>> y = "20"
>>> print(x + y)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for +: 'int' and 'str'
Question 7hardmultiple choice
Full question →

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

Exhibit

>>> x = 10
>>> while x > 0:
...     x = x - 3
...     if x == 4:
...         break
... else:
...     print('Loop ended normally')
>>> print(x)
Question 8hardmultiple choice
Full question →

Refer to the exhibit. The code used is: name = input('Enter name: '); print('Hello', name). What will be printed if the user enters 'Alice'?

Exhibit

Enter name: Bob
Hello Bob
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 10hardmultiple choice
Full question →

What is the output of the code in the exhibit?

Exhibit

Refer to the exhibit.

```
my_list = [1, 2, 3, 4, 5]
my_list[1:3] = [10, 20]
print(my_list)
```
Question 11mediummultiple 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 12easymultiple choice
Full question →

Refer to the exhibit. What is the output?

Exhibit

try:
    x = int("hello")
except ValueError:
    print("Invalid integer")
except:
    print("Some error")
Question 13hardmultiple choice
Full question →

Refer to the exhibit. What is the output?

Exhibit

def modify_dict(d):
    d['key'] = 'new_value'
    d = {'another': 'dict'}

my_dict = {'key': 'old_value'}
modify_dict(my_dict)
print(my_dict)
Question 14mediummultiple choice
Full question →

Refer to the exhibit. What is the output?

Exhibit

>>> t = (1, 2, 3)
>>> try:
...     t[1] = 10
... except TypeError:
...     print('Error')
... else:
...     print('Ok')
... finally:
...     print('End')
Question 15hardmultiple 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')

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.