Python Institute PCEP-30-02 Practice Exam Questions & Answers

7 Free Questions Last reviewed November 11, 2026 Prepared & Reviewed by the ValidExamDumps Editorial Team

30 Practice Questions (Our Bank)
40 minutes Exam Duration
70% Passing Score
USD 59 Official Exam Fee
Exam Facts

Python Institute PCEP-30-02 Exam Details

Key details for this exam, checked against the published exam outline

Exam Code
PCEP-30-02
Full Name
PCEP - Certified Entry-Level Python Programmer
Issuing Body
Python Institute
Question Format (Our Bank)
Multiple Choice, Drag & Drop
Delivery
Online proctored via TestNow platform or at authorized testing centers
Eligibility
None
Validity
Lifetime
Practice Questions

Free PCEP-30-02 Practice Questions

Each question shows the correct answer and an explanation of why it is right

VA
ValidExamDumps Editorial Team Every question and its answer is checked by our PCEP-30-02 exam preparation team, who also write the explanation shown with each one. How we research and review these pages

Question 1 Domain 5 Functions and Exceptions

What is the expected output of the following code?

Question 1 exhibit

Correct Answer C
Explanation

The code snippet that you have sent is a conditional statement that checks if a variable ''counter'' is less than 0, greater than or equal to 42, or neither. The code is as follows:

if counter < 0: print('''') elif counter >= 42: print('''') else: print('''')

The code starts with checking if the value of ''counter'' is less than 0. If yes, it prints a single asterisk () to the screen and exits the statement. If no, it checks if the value of ''counter'' is greater than or equal to 42. If yes, it prints three asterisks () to the screen and exits the statement. If no, it prints two asterisks () to the screen and exits the statement.

The expected output of the code depends on the value of ''counter''. If the value of ''counter'' is 10, as shown in the image, the code will print two asterisks (**) to the screen, because 10 is neither less than 0 nor greater than or equal to 42. Therefore, the correct answer is C. * *

Question 2 Domain 8 User Management

What happens when the user runs the following code?

Question 2 exhibit

Correct Answer D
Explanation

The code snippet that you have sent is a while loop with an if statement and a print statement inside it. The code is as follows:

while True: if counter < 0: print('''') else: print(''**'')

The code starts with entering a while loop that repeats indefinitely, because the condition ''True'' is always true. Inside the loop, the code checks if the value of ''counter'' is less than 0. If yes, it prints a single asterisk () to the screen. If no, it prints three asterisks (**) to the screen. However, the code does not change the value of ''counter'' inside the loop, so the same condition is checked over and over again. The loop never ends, and the code enters an infinite loop.

The program outputs either one asterisk () or three asterisks (**) to the screen repeatedly, depending on the initial value of ''counter''. Therefore, the correct answer is D. The program enters an infinite loop.

Question 3 Domain 4 Data Collections

Assuming that the following assignment has been successfully executed:

My_list -- [1, 1, 2, 3]

Select the expressions which will not raise any exception.

(Select two expressions.)

Correct Answer B, D
Explanation

The code snippet that you have sent is assigning a list of four numbers to a variable called ''my_list''. The code is as follows:

my_list = [1, 1, 2, 3]

The code creates a list object that contains the elements 1, 1, 2, and 3, and assigns it to the variable ''my_list''. The list can be accessed by using the variable name or by using the index of the elements. The index starts from 0 for the first element and goes up to the length of the list minus one for the last element. The index can also be negative, in which case it counts from the end of the list. For example, my_list[0] returns 1, and my_list[-1] returns 3.

The code also allows some operations on the list, such as slicing, concatenation, repetition, and membership. Slicing is used to get a sublist of the original list by specifying the start and end index. For example, my_list[1:3] returns [1, 2]. Concatenation is used to join two lists together by using the + operator. For example, my_list + [4, 5] returns [1, 1, 2, 3, 4, 5]. Repetition is used to create a new list by repeating the original list a number of times by using the * operator. For example, my_list * 2 returns [1, 1, 2, 3, 1, 1, 2, 3]. Membership is used to check if an element is present in the list by using the in operator. For example, 2 in my_list returns True, and 4 in my_list returns False.

The expressions that you have given are trying to access or manipulate the list in different ways. Some of them are valid, and some of them are invalid and will raise an exception. An exception is an error that occurs when the code cannot be executed properly. The expressions are as follows:

A) my_list[-10]: This expression is trying to access the element at the index -10 of the list. However, the list only has four elements, so the index -10 is out of range. This will raise an IndexError exception and output nothing.

B) my_list|my_Li1st | 3| I: This expression is trying to perform a bitwise OR operation on the list and some other operands. The bitwise OR operation is used to compare the binary representation of two numbers and return a new number that has a 1 in each bit position where either number has a 1. For example, 3 | 1 returns 3, because 3 in binary is 11 and 1 in binary is 01, and 11 | 01 is 11. However, the bitwise OR operation cannot be applied to a list, because a list is not a number. This will raise a TypeError exception and output nothing.

C) my list [6]: This expression is trying to access the element at the index 6 of the list. However, the list only has four elements, so the index 6 is out of range. This will raise an IndexError exception and output nothing.

D) my_List- [0:1]: This expression is trying to perform a subtraction operation on the list and a sublist. The subtraction operation is used to subtract one number from another and return the difference. For example, 3 - 1 returns 2. However, the subtraction operation cannot be applied to a list, because a list is not a number. This will raise a TypeError exception and output nothing.

Only two expressions will not raise any exception. They are:

B) my_list|my_Li1st | 3| I: This expression is not a valid Python code, but it is not an expression that tries to access or manipulate the list. It is just a string of characters that has no meaning. Therefore, it will not raise any exception, but it will also not output anything.

D) my_List- [0:1]: This expression is a valid Python code that uses the slicing operation to get a sublist of the list. The slicing operation does not raise any exception, even if the start or end index is out of range. It will just return an empty list or the closest possible sublist. For example, my_list[0:10] returns [1, 1, 2, 3], and my_list[10:20] returns []. The expression my_List- [0:1] returns the sublist of the list from the index 0 to the index 1, excluding the end index. Therefore, it returns [1]. This expression will not raise any exception, and it will output [1].

Therefore, the correct answers are B. my_list|my_Li1st | 3| I and D. my_List- [0:1].

Get the complete PCEP-30-02 question set $20$40

Get Full Access

Question 4 Domain 5 Functions and Exceptions

What is the expected output of the following code?

Question 4 exhibit

Correct Answer C
Explanation

The code snippet that you have sent is checking if two numbers are equal and printing the result. The code is as follows:

num1 = 1 num2 = 2 if num1 == num2: print(4) else: print(1)

The code starts with assigning the values 1 and 2 to the variables ''num1'' and ''num2'' respectively. Then, it enters an if statement that compares the values of ''num1'' and ''num2'' using the equality operator (==). If the values are equal, the code prints 4 to the screen. If the values are not equal, the code prints 1 to the screen.

The expected output of the code is 1, because the values of ''num1'' and ''num2'' are not equal. Therefore, the correct answer is C. 1.

Question 5 Domain 1 Computer Programming Fundamentals

Which of the following expressions evaluate to a non-zero result? (Select two answers.)

Correct Answer A, B
Explanation

In Python, the ** operator is used for exponentiation, the / operator is used for floating-point division, and the // operator is used for integer division. The order of operations is parentheses, exponentiation, multiplication/division, and addition/subtraction. Therefore, the expressions can be evaluated as follows:

A) 2 ** 3 / A - 2 = 8 / A - 2 (assuming A is a variable that is not zero or undefined) B. 4 / 2 * * 3 - 2 = 4 / 8 - 2 = 0.5 - 2 = -1.5 C. 1 * * 3 / 4 - 1 = 1 / 4 - 1 = 0.25 - 1 = -0.75 D. 1 * 4 // 2 ** 3 = 4 // 8 = 0

Only expressions A and B evaluate to non-zero results.

Question 6 Domain 2 Control Flow

What is true about exceptions and debugging? (Select two answers.)

Correct Answer A, C
Explanation

Exceptions and debugging are two important concepts in Python programming that are related to handling and preventing errors. Exceptions are errors that occur when the code cannot be executed properly, such as syntax errors, type errors, index errors, etc. Debugging is the process of finding and fixing errors in the code, using various tools and techniques. Some of the facts about exceptions and debugging are:

A tool that allows you to precisely trace program execution is called a debugger. A debugger is a program that can run another program step by step, inspect the values of variables, set breakpoints, evaluate expressions, etc. A debugger can help you find the source and cause of an error, and test possible solutions. Python has a built-in debugger module called pdb, which can be used from the command line or within the code.There are also other third-party debuggers available for Python, such as PyCharm, Visual Studio Code, etc12

If some Python code is executed without errors, this does not prove that there are no errors in it. It only means that the code did not encounter any exceptions that would stop the execution. However, the code may still have logical errors, which are errors that cause the code to produce incorrect or unexpected results. For example, if you write a function that is supposed to calculate the area of a circle, but you use the wrong formula, the code may run without errors, but it will give you the wrong answer. Logical errors are harder to detect and debug than syntax or runtime errors, because they do not generate any error messages.You have to test the code with different inputs and outputs, and compare them with the expected results34

One try-except block may contain more than one except branch. A try-except block is a way of handling exceptions in Python, by using the keywords try and except. The try block contains the code that may raise an exception, and the except block contains the code that will execute if an exception occurs. You can have multiple except blocks for different types of exceptions, or for different actions to take. For example, you can write a try-except block like this:

try: # some code that may raise an exception except ValueError: # handle the ValueError exception except ZeroDivisionError: # handle the ZeroDivisionError exception except: # handle any other exception

This way, you can customize the error handling for different situations, and provide more informative messages or alternative solutions5

The default (anonymous) except branch can be the last branch in the try-except block. The default except branch is the one that does not specify any exception type, and it will catch any exception that is not handled by the previous except branches. The default except branch can be the last branch in the try-except block, but it cannot be the first or the only branch. For example, you can write a try-except block like this:

try: # some code that may raise an exception except ValueError: # handle the ValueError exception except: # handle any other exception

This is a valid try-except block, and the default except branch will be the last branch. However, you cannot write a try-except block like this:

try: # some code that may raise an exception except: # handle any exception

This is an invalid try-except block, because the default except branch is the only branch, and it will catch all exceptions, even those that are not errors, such as KeyboardInterrupt or SystemExit. This is considered a bad practice, because it may hide or ignore important exceptions that should be handled differently or propagated further.Therefore, you should always specify the exception types that you want to handle, and use the default except branch only as a last resort5

Therefore, the correct answers are A. A tool that allows you to precisely trace program execution is called a debugger. and C. One try-except block may contain more than one except branch.

Question 7 Domain 5 Functions and Exceptions

A set of rules which defines the ways in which words can be coupled in sentences is called:

Correct Answer B
Explanation

Syntax is the branch of linguistics that studies the structure and rules of sentences in natural languages. Lexis is the vocabulary of a language. Semantics is the study of meaning in language. A dictionary is a collection of words and their definitions, synonyms, pronunciations, etc.

Study Guide

What the Python Institute PCEP-30-02 Exam Covers

Exam domains verified against the Official Python Institute PCEP-30-02 exam guide, last checked November 2026.

Domain 1 Computer Programming Fundamentals

Covers interpreters, compilers, syntax, and semantics. Assesses Python essentials including keywords, instructions, indentation, and commenting. Includes data types (Booleans, integers, floats, strings), variable usage, naming conventions, and operator types (arithmetic, string, assignment, bitwise, Boolean, and relational).

Sample question from this domain above Q5

Domain 2 Control Flow

Tests conditional statements such as if, if-else, if-elif, and if-elif-else. Evaluates looping structures like while and for loops, including use of range. Covers loop control mechanisms and nesting of both loops and conditional statements.

Sample question from this domain above Q6

Domain 3 Control Flow

Tests conditional statements such as if, if-else, if-elif, and if-elif-else. Evaluates looping structures like while and for loops, including use of range. Covers loop control mechanisms and nesting of both loops and conditional statements.

Domain 4 Data Collections

Focuses on working with data structures including lists (creation, indexing, slicing, method usage, list comprehensions) and tuples. Evaluates proficiency with dictionaries and string manipulation, including construction, indexing, and relevant methods.

Sample question from this domain above Q3

Domain 5 Functions and Exceptions

Examines ability to define and invoke functions, understand parameter passing, arguments, and scope rules. Includes assessment of recursion concepts and Python's exception hierarchy. Tests knowledge of exception-handling techniques, including try-except blocks.

Sample questions from this domain above Q1Q4Q7

Domain 6 Configuration Management

This portion delves into General Configuration and User Experience Customizations, including the modification of Page Layouts and the setup of Task Time Entry Mode. It also covers the creation and management of Report and Dashboard Folders for effective data visualization and analysis.

Domain 7 Automated Jobs & Scheduled Maintenance

This section focuses on the scheduling and management of automated jobs, including their review, deletion, and routine maintenance. It also covers the configuration of 'Actuals Configuration Group' and setting calculation modes. Lastly, it addresses App Log Maintenance, emphasizing the importance of regular review and cleanup.

Domain 8 User Management

This segment examines Security aspects, detailing how to manage User Access through various means such as Permission Sets, Profiles, and Package Licenses. It also covers Permission Controls and their assignment. The section concludes with Workspaces, explaining how to configure and assign them to new users, as well as how to maintain and edit them to accurately reflect organizational personas.

Sample question from this domain above Q2

FAQ

PCEP-30-02 Exam FAQ

Common questions about the exam itself

What experience do I need before sitting PCEP-30-02?
No formal prerequisites exist. You should be familiar with basic programming concepts like variables, conditions, loops, and functions before attempting PCEP-30-02, but you do not need professional experience or prior certifications.
How long should I study for PCEP-30-02?
Most candidates prepare for 3 to 5 weeks, though this depends on your starting experience. If basic programming concepts feel like a foreign language to you, budget 6 to 8 weeks instead. This exam has a tight time budget, so structured practice with timed questions is essential.
What makes PCEP-30-02 hard or easy compared to other certifications?
PCEP-30-02 is an entry-level exam and the most affordable in the Python Institute track. The difficulty lies not in concept depth but in speed and precision, you must answer 30 questions in 40 minutes with no partial credit. Control Flow and Functions and Exceptions together carry 57 percent of the exam weight.
How many questions can I get wrong and still pass PCEP-30-02?
You need 70 percent to pass. With 30 questions, you can answer approximately 9 questions incorrectly and still pass. Since there is no penalty for wrong answers, you should attempt every question.
What question types appear on PCEP-30-02?
The exam uses single-select multiple choice, multiple-select multiple choice, drag-and-drop, gap fill, code fill, code insertion, and interactive scenario-based questions. Many questions require you to assemble working code rather than just identify problems.
Can I retake PCEP-30-02 if I fail?
Yes, you can retake the exam. A single-shot exam costs USD 59, while a voucher with one retake included costs USD 76.70. There is no published limit on retake attempts.
Does PCEP-30-02 expire, and do I need to recertify?
No. PCEP-30-02 is a lifetime certification. Once you pass, your credential never expires and requires no recertification fee or continuing education credits.
How does PCEP-30-02 relate to PCAP and the higher Python certs?
PCEP-30-02 is entry-level and a stepping stone to PCAP (Associate level). PCEP covers functions, exceptions, and built-in collections but stops there. PCAP and PCPP levels require classes, modules, file handling, and more advanced design. PCAP and PCPP do not require you to hold PCEP first, though PCEP provides a low-cost rehearsal.
Where do I sit PCEP-30-02, and what do I need on exam day?
The exam is delivered online via TestNow, the Python Institute's secure proctoring platform. You can take it from home with a webcam and remote proctor, or at an authorized testing center. You will need a valid photo ID and a computer with a stable internet connection.
What job role does PCEP-30-02 prepare me for?
PCEP-30-02 validates foundational skills for entry-level Python programmer and junior developer roles. It demonstrates to employers that you understand Python syntax, can write small programs independently, and grasp core concepts needed for progression to more advanced roles.

Other Python Institute Exams

Free practice questions for more Python Institute certification exams

All Python Institute exams