Python Institute PCEP-30-02 Exam Dumps, Practice Test Questions

100% Latest & Updated Python Institute PCEP-30-02 Practice Test Questions, Exam Dumps & Verified Answers!
30 Days Free Updates, Instant Download!

Python Institute PCEP-30-02  Premium File
$54.99
$49.99

PCEP-30-02 Premium File

  • Premium File: 481 Questions & Answers. Last update: Nov 25, 2026
  • Latest Questions
  • 100% Accurate Answers
  • Fast Exam Updates

PCEP-30-02 Premium File

Python Institute PCEP-30-02  Premium File
  • Premium File: 481 Questions & Answers. Last update: Nov 25, 2026
  • Latest Questions
  • 100% Accurate Answers
  • Fast Exam Updates
$54.99
$49.99

Python Institute PCEP-30-02 Practice Test 38

Question 370

A developer tests ArithmeticError inheritance. The following code prints 'true'. Which explanation best accounts for that observed behavior?print(issubclass(ArithmeticError,Exception))

  1. A recursive sum decreases the input until its base case and combines each return value on the way back.
  2. An inner try-except handles matching exceptions; otherwise an outer compatible handler can receive the propagated error.
  3. ZeroDivisionError inherits from ArithmeticError which itself inherits from Exception.
  4. Providing a parameter both positionally and by keyword causes TypeError for multiple values.

Explanation

Correct Answer

C:

This is the operative language rule for the code. It directly explains why the exampleprints 'true'; the displayed behavior was independently reproduced by a Python 3 execution check.

Incorrect Answers

A:

That statement describes the separate topic recursive summation. It does not account for this example, whose result isprints 'true'. The relevant rule is: ZeroDivisionError inherits from ArithmeticError which itself inherits from Exception.

B:

That statement describes the separate topic nested try except responsibility. It does not account for this example, whose result isprints 'true'. The relevant rule is: ZeroDivisionError inherits from ArithmeticError which itself inherits from Exception.

D:

That statement describes the separate topic duplicate argument assignment raises TypeError. It does not account for this example, whose result isprints 'true'. The relevant rule is: ZeroDivisionError inherits from ArithmeticError which itself inherits from Exception.

Question 371

A learner is checking ArithmeticError inheritance. After this modification, what does Python 3 actually do?print(issubclass(KeyError,ArithmeticError))

  1. Prints '0'
  2. Prints '1'
  3. Prints 'False'
  4. Prints 'True'

Explanation

Correct Answer

C:

The snippet prints 'false'. ZeroDivisionError inherits from ArithmeticError which itself inherits from Exception.

Incorrect Answers

A:

This predicts that the snippet prints '0', but executing the displayed Python 3 code prints 'false'. ZeroDivisionError inherits from ArithmeticError which itself inherits from Exception.

B:

This predicts that the snippet prints '1', but executing the displayed Python 3 code prints 'false'. ZeroDivisionError inherits from ArithmeticError which itself inherits from Exception.

D:

This predicts that the snippetprints 'true', but executing the displayed Python 3 code prints 'false'. ZeroDivisionError inherits from ArithmeticError which itself inherits from Exception.

Question 372

During a review of ArithmeticError inheritance, three independent Python 3 fragments are shown. Which THREE statements accurately describe their behavior? (Choose THREE.)Program A: print(issubclass(ArithmeticError,Exception)) Program B: print(issubclass(KeyError,ArithmeticError)) Program C: print(issubclass(ZeroDivisionError,LookupError))

  1. Program A prints 'true'.
  2. Program A prints 'even'.
  3. Program B prints 'false'.
  4. Program B prints 'index'.
  5. Program C prints 'outer'.
  6. Program C prints 'false'.

Explanation

Correct Answers

A:

Running Program Aprints 'true'. ZeroDivisionError inherits from ArithmeticError which itself inherits from Exception.

C:

Running Program B prints 'false'. ZeroDivisionError inherits from ArithmeticError which itself inherits from Exception.

F:

Running Program C prints 'false'. ZeroDivisionError inherits from ArithmeticError which itself inherits from Exception.

Incorrect Answers

B:

Program A does not produce 'even'; its verified result is:prints 'True'. ZeroDivisionError inherits from ArithmeticError which itself inherits from Exception.

D:

Program B does not produce 'index'; its verified result is: Prints 'False'. ZeroDivisionError inherits from ArithmeticError which itself inherits from Exception.

E:

Program C does not produce 'outer'; its verified result is: Prints 'False'. ZeroDivisionError inherits from ArithmeticError which itself inherits from Exception.

Question 373

A learner is checking BaseException versus Exception. What is the exact printed result or uncaught exception?print(issubclass(KeyboardInterrupt,Exception))

  1. Prints '0'
  2. Prints 'True'
  3. Prints '1'
  4. Prints 'False'

Explanation

Correct Answer

D:

The snippet prints 'false'. KeyboardInterrupt and SystemExit derive from BaseException but not from the Exception subclass.

Incorrect Answers

A:

This predicts that the snippet prints '0', but executing the displayed Python 3 code prints 'false'. KeyboardInterrupt and SystemExit derive from BaseException but not from the Exception subclass.

B:

This predicts that the snippetprints 'true', but executing the displayed Python 3 code prints 'false'. KeyboardInterrupt and SystemExit derive from BaseException but not from the Exception subclass.

C:

This predicts that the snippet prints '1', but executing the displayed Python 3 code prints 'false'. KeyboardInterrupt and SystemExit derive from BaseException but not from the Exception subclass.

Question 374

A developer tests BaseException versus Exception. The following code prints 'true'. Which explanation best accounts for that observed behavior?print(issubclass(SystemExit,BaseException))

  1. KeyboardInterrupt and SystemExit derive from BaseException but not from the Exception subclass.
  2. The except clause matching the raised exception class handles the error and allows execution to continue.
  3. Once a function returns, the remaining statements in that function call are not executed.
  4. A global declaration makes assignment inside the function modify the module-level name.

Explanation

Correct Answer

A:

This is the operative language rule for the code. It directly explains why the exampleprints 'true'; the displayed behavior was independently reproduced by a Python 3 execution check.

Incorrect Answers

B:

That statement describes the separate topic exact exception handler selection. It does not account for this example, whose result isprints 'true'. The relevant rule is: KeyboardInterrupt and SystemExit derive from BaseException but not from the Exception subclass.

C:

That statement describes the separate topic early return versus later statements. It does not account for this example, whose result isprints 'true'. The relevant rule is: KeyboardInterrupt and SystemExit derive from BaseException but not from the Exception subclass.

D:

That statement describes the separate topic global declaration changes module binding. It does not account for this example, whose result isprints 'true'. The relevant rule is: KeyboardInterrupt and SystemExit derive from BaseException but not from the Exception subclass.

Question 375

A learner is checking BaseException versus Exception. After this modification, what does Python 3 actually do?print(issubclass(SystemExit,Exception))

  1. Prints '1'
  2. Prints 'False'
  3. Prints 'True'
  4. Prints '0'

Explanation

Correct Answer

B:

The snippet prints 'false'. KeyboardInterrupt and SystemExit derive from BaseException but not from the Exception subclass.

Incorrect Answers

A:

This predicts that the snippet prints '1', but executing the displayed Python 3 code prints 'false'. KeyboardInterrupt and SystemExit derive from BaseException but not from the Exception subclass.

C:

This predicts that the snippetprints 'true', but executing the displayed Python 3 code prints 'false'. KeyboardInterrupt and SystemExit derive from BaseException but not from the Exception subclass.

D:

This predicts that the snippet prints '0', but executing the displayed Python 3 code prints 'false'. KeyboardInterrupt and SystemExit derive from BaseException but not from the Exception subclass.

Question 376

During a review of BaseException versus Exception, three independent Python 3 fragments are shown. Which THREE statements accurately describe their behavior? (Choose THREE.)Program A: print(issubclass(SystemExit,BaseException)) Program B: print(issubclass(SystemExit,Exception)) Program C: print(issubclass(KeyboardInterrupt,BaseException))

  1. Program C prints 'true'.
  2. Program B prints 'broad'.
  3. Program C prints 'none'.
  4. Program A prints 'true'.
  5. Program B prints 'false'.
  6. Program A prints 'even'.

Explanation

Correct Answers

A:

Running Program Cprints 'true'. KeyboardInterrupt and SystemExit derive from BaseException but not from the Exception subclass.

D:

Running Program Aprints 'true'. KeyboardInterrupt and SystemExit derive from BaseException but not from the Exception subclass.

E:

Running Program B prints 'false'. KeyboardInterrupt and SystemExit derive from BaseException but not from the Exception subclass.

Incorrect Answers

B:

Program B does not produce 'broad'; its verified result is: Prints 'False'. KeyboardInterrupt and SystemExit derive from BaseException but not from the Exception subclass.

C:

Program C does not produce 'none'; its verified result is:prints 'True'. KeyboardInterrupt and SystemExit derive from BaseException but not from the Exception subclass.

F:

Program A does not produce 'even'; its verified result is:prints 'True'. KeyboardInterrupt and SystemExit derive from BaseException but not from the Exception subclass.

Question 377

A learner is checking IndexError and KeyError distinct. What is the exact printed result or uncaught exception?print([1,2][3])

  1. Raises TypeError
  2. Raises ValueError
  3. Raises KeyError
  4. Raises IndexError

Explanation

Correct Answer

D:

The snippet raises indexerror. An absent list index produces IndexError whereas a missing dictionary key produces KeyError.

Incorrect Answers

A:

This predicts that the snippet raises typeerror, but executing the displayed Python 3 code raises indexerror. An absent list index produces IndexError whereas a missing dictionary key produces KeyError.

B:

This predicts that the snippet raises valueerror, but executing the displayed Python 3 code raises indexerror. An absent list index produces IndexError whereas a missing dictionary key produces KeyError.

C:

This predicts that the snippet raises keyerror, but executing the displayed Python 3 code raises indexerror. An absent list index produces IndexError whereas a missing dictionary key produces KeyError.

Question 378

A developer tests IndexError and KeyError distinct. The following code raises keyerror. Which explanation best accounts for that observed behavior?print({"x":1}["y"])

  1. An uncaught exception raised inside a function propagates to the caller where a matching except can catch it.
  2. An absent list index produces IndexError whereas a missing dictionary key produces KeyError.
  3. Exception handlers are checked in order; a broad superclass handler before a specific one makes the later one unreachable.
  4. The result returned by one function can be passed directly as an argument to another function.

Explanation

Correct Answer

B:

This is the operative language rule for the code. It directly explains why the example raises keyerror; the displayed behavior was independently reproduced by a Python 3 execution check.

Incorrect Answers

A:

The exceptions propagate across function calls topic does not explain why the code raises keyerror. The relevant Python rule is: An absent list index produces IndexError whereas a missing dictionary key produces KeyError.

C:

The first matching except branch topic does not explain why the code raises keyerror. The relevant Python rule is: An absent list index produces IndexError whereas a missing dictionary key produces KeyError.

D:

The function call composition topic does not explain why the code raises keyerror. The relevant Python rule is: An absent list index produces IndexError whereas a missing dictionary key produces KeyError.

Question 379

A learner is checking IndexError and KeyError distinct. After this modification, what does Python 3 actually do?print([5,6][-1])

  1. Prints '8'
  2. Prints '5'
  3. Prints '6'
  4. Prints '7'

Explanation

Correct Answer

C:

The snippet prints '6'. An absent list index produces IndexError whereas a missing dictionary key produces KeyError.

Incorrect Answers

A:

This predicts that the snippet prints '8', but executing the displayed Python 3 code prints '6'. An absent list index produces IndexError whereas a missing dictionary key produces KeyError.

B:

This predicts that the snippet prints '5', but executing the displayed Python 3 code prints '6'. An absent list index produces IndexError whereas a missing dictionary key produces KeyError.

D:

This predicts that the snippet prints '7', but executing the displayed Python 3 code prints '6'. An absent list index produces IndexError whereas a missing dictionary key produces KeyError.

Question 380

During a review of IndexError and KeyError distinct, three independent Python 3 fragments are shown. Which THREE statements accurately describe their behavior? (Choose THREE.)Program A: print({"x":1}["y"]) Program B: print([5,6][-1]) Program C: print({"a":9}["a"])

  1. Program B prints '5'.
  2. Program A prints '[1, 7]'.
  3. Program B prints '6'.
  4. Program C prints '9'.
  5. Program C prints '2'.
  6. Program A raises keyerror.

Explanation

Correct Answers

C:

Running Program B prints '6'. An absent list index produces IndexError whereas a missing dictionary key produces KeyError.

D:

Running Program C prints '9'. An absent list index produces IndexError whereas a missing dictionary key produces KeyError.

F:

Running Program A raises keyerror. An absent list index produces IndexError whereas a missing dictionary key produces KeyError.

Incorrect Answers

A:

Program B does not produce '5'; its verified result is: Prints '6'. An absent list index produces IndexError whereas a missing dictionary key produces KeyError.

B:

Program A does not produce '[1, 7]'; its verified result is: Raises KeyError. An absent list index produces IndexError whereas a missing dictionary key produces KeyError.

E:

Program C does not produce '2'; its verified result is: Prints '9'. An absent list index produces IndexError whereas a missing dictionary key produces KeyError.

PCEP - Certified Entry-Level Python Programmer (PCEP-30-02) Practice Tests

UP

SPECIAL OFFER: GET 10% OFF

This is ONE TIME OFFER

ExamSnap Discount Offer
Enter Your Email Address to Receive Your 10% Off Discount Code

A confirmation link will be sent to this email address to verify your login. *We value your privacy. We will not rent or sell your email address.

Download Free Demo of VCE Exam Simulator

Experience Avanset VCE Exam Simulator for yourself.

Simply submit your e-mail address below to get started with our interactive software demo of your free trial.

Free Demo Limits: In the demo version you will be able to access only first 5 questions from exam.