About the Exam

PCEP-30-02 is the current active PCEP exam version from Python Institute and is aimed at candidates starting out in Python programming. The exam assesses the ability to write, understand, and debug simple Python programs, including syntax, semantics, control flow, data types, functions, exceptions, and basic problem-solving techniques. Passing demonstrates foundational, practical Python programming knowledge at entry level.

Exam Topics

  • Computer Programming and Python Fundamentals18%
  • Control Flow – Conditional Blocks and Loops29%
  • Data Collections – Tuples, Dictionaries, Lists, and Strings25%
  • Functions and Exceptions28%

How to Use This Practice Exam

  1. Browse — Read each question, select your answer, and reveal the explanation.
  2. Exam Mode — Simulate real exam conditions with a timed session and score report.
  3. Learn Mode — Spaced repetition schedules questions you struggle with for long-term retention.

Download the Full Exam PDF

Get every question and answer in a clean, printable PDF built for offline study. Purchase once, keep permanent access, and re-download the latest version anytime.

Last updated July 28, 2026

Topic filter
Question status
Question sort
Questions per page

QuestionQ1

VerifiedData Collections – Tuples, Dictionaries, Lists, and Strings

What is the expected output from the following code?

Question Image

Explanation

Python’s str.lower() converts uppercase letters in a string to lowercase and leaves the @ symbol and exclamation marks unchanged. The resulting printed text is hello@peter!!.

Community Discussion

No comments yet. Be the first to start the discussion!

QuestionQ2

VerifiedComputer Programming and Python Fundamentals

Place the code boxes in the proper order to create a line of code that prompts the user for an integer and assigns it to the depth variable.

Some code boxes are not needed.

Drag & Drop
depth 
Explanation

input() obtains the user’s response as text, and int() converts that response to an integer before it is assigned to depth. The prompt text is supplied to input(); float( and == do not create the required integer assignment.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!

QuestionQ3

VerifiedFunctions and Exceptions

Which of these functions can be called using two arguments?

Explanation

A function with one required parameter and one parameter that has a default value can be invoked with two positional arguments; the second supplied argument overrides the default value.

Community Discussion

No comments yet. Be the first to start the discussion!

QuestionQ4

VerifiedFunctions and Exceptions

What is the output of this snippet?

Question Image

Explanation

The expression x + 1 passes 3 to fun. The function increments its local parameter by 1, returns 4, and that returned value is assigned to x; therefore, print(x) outputs 4.

Community Discussion

No comments yet. Be the first to start the discussion!

QuestionQ5

VerifiedData Collections – Tuples, Dictionaries, Lists, and Strings

Which code should replace the comment to produce the expected output?

Expected output:

Question Image

Code:

Question Image

Explanation

Each dictionary value is a one-element tuple containing its associated key value. Accessing index 0 of k returns the contained string, so print(k[0]) outputs a, b, and c on separate lines.

Community Discussion

No comments yet. Be the first to start the discussion!
Know a question that should be here? Contribute to this exam
Back home