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 37

Question 360

During a review of duplicate argument assignment raises TypeError, three independent Python 3 fragments are shown. Which THREE statements accurately describe their behavior? (Choose THREE.)Program A: def f(a,b): return a+b print(f(1,a=2,b=3)) Program B: def f(x,y): return x+y print(f(1,y=2)) Program C: def f(x=1): return x print(f(x=4))

  1. Program B prints '3'.
  2. Program A raises typeerror.
  3. Program A raises nameerror.
  4. Program C prints '4'.
  5. Program C prints '8'.
  6. Program B prints '6'.

Explanation

Correct Answers

A:

Running Program B prints '3'. Providing a parameter both positionally and by keyword causes TypeError for multiple values.

B:

Running Program A raises typeerror. Providing a parameter both positionally and by keyword causes TypeError for multiple values.

D:

Running Program C prints '4'. Providing a parameter both positionally and by keyword causes TypeError for multiple values.

Incorrect Answers

C:

Program A does not raises nameerror; its verified result is: Raises TypeError. Providing a parameter both positionally and by keyword causes TypeError for multiple values.

E:

Program C does not produce '8'; its verified result is: Prints '4'. Providing a parameter both positionally and by keyword causes TypeError for multiple values.

F:

Program B does not produce '6'; its verified result is: Prints '3'. Providing a parameter both positionally and by keyword causes TypeError for multiple values.

Question 361

A learner is checking ValueError versus TypeError in conversion. What is the exact printed result or uncaught exception?print(int("twelve"))

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

Explanation

Correct Answer

A:

The snippet raises valueerror. int raises ValueError for text that cannot represent an integer; incompatible argument types raise TypeError.

Incorrect Answers

B:

This predicts that the snippet raises typeerror, but executing the displayed Python 3 code raises valueerror. int raises ValueError for text that cannot represent an integer; incompatible argument types raise TypeError.

C:

This predicts that the snippet raises keyerror, but executing the displayed Python 3 code raises valueerror. int raises ValueError for text that cannot represent an integer; incompatible argument types raise TypeError.

D:

This predicts that the snippet raises indexerror, but executing the displayed Python 3 code raises valueerror. int raises ValueError for text that cannot represent an integer; incompatible argument types raise TypeError.

Question 362

A developer tests ValueError versus TypeError in conversion. The following code prints '13'. Which explanation best accounts for that observed behavior?print(int("12")+1)

  1. int raises ValueError for text that cannot represent an integer; incompatible argument types raise TypeError.
  2. Once a function returns, the remaining statements in that function call are not executed.
  3. A Python function without a reachable return statement returns the singleton None.
  4. An absent list index produces IndexError whereas a missing dictionary key produces KeyError.

Explanation

Correct Answer

A:

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

Incorrect Answers

B:

The early return versus later statements topic does not explain why the code prints '13'. The relevant Python rule is: int raises ValueError for text that cannot represent an integer; incompatible argument types raise TypeError.

C:

The implicit None return topic does not explain why the code prints '13'. The relevant Python rule is: int raises ValueError for text that cannot represent an integer; incompatible argument types raise TypeError.

D:

The IndexError and KeyError distinct topic does not explain why the code prints '13'. The relevant Python rule is: int raises ValueError for text that cannot represent an integer; incompatible argument types raise TypeError.

Question 363

A learner is checking ValueError versus TypeError in conversion. After this modification, what does Python 3 actually do?print(int(None))

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

Explanation

Correct Answer

B:

The snippet raises typeerror. int raises ValueError for text that cannot represent an integer; incompatible argument types raise TypeError.

Incorrect Answers

A:

This predicts that the snippet raises indexerror, but executing the displayed Python 3 code raises typeerror. int raises ValueError for text that cannot represent an integer; incompatible argument types raise TypeError.

C:

This predicts that the snippet raises valueerror, but executing the displayed Python 3 code raises typeerror. int raises ValueError for text that cannot represent an integer; incompatible argument types raise TypeError.

D:

This predicts that the snippet raises keyerror, but executing the displayed Python 3 code raises typeerror. int raises ValueError for text that cannot represent an integer; incompatible argument types raise TypeError.

Question 364

During a review of ValueError versus TypeError in conversion, three independent Python 3 fragments are shown. Which THREE statements accurately describe their behavior? (Choose THREE.)Program A: print(int("12")+1) Program B: print(int(None)) Program C: print(int("3.0"))

  1. Program A prints 'ab'.
  2. Program A prints '13'.
  3. Program C raises valueerror.
  4. Program B raises typeerror.
  5. Program C raises indexerror.
  6. Program B prints 'handled'.

Explanation

Correct Answers

B:

Running Program A prints '13'. int raises ValueError for text that cannot represent an integer; incompatible argument types raise TypeError.

C:

Running Program C raises valueerror. int raises ValueError for text that cannot represent an integer; incompatible argument types raise TypeError.

D:

Running Program B raises typeerror. int raises ValueError for text that cannot represent an integer; incompatible argument types raise TypeError.

Incorrect Answers

A:

Program A does not produce 'ab'; its verified result is: Prints '13'. int raises ValueError for text that cannot represent an integer; incompatible argument types raise TypeError.

E:

Program C does not raises indexerror; its verified result is: Raises ValueError. int raises ValueError for text that cannot represent an integer; incompatible argument types raise TypeError.

F:

Program B does not produce 'handled'; its verified result is: Raises TypeError. int raises ValueError for text that cannot represent an integer; incompatible argument types raise TypeError.

Question 365

A learner is checking LookupError ancestry. What is the exact printed result or uncaught exception?print(issubclass(IndexError,LookupError))

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

Explanation

Correct Answer

D:

The snippetprints 'true'. IndexError and KeyError are distinct subclasses of LookupError and can be caught by its common superclass.

Incorrect Answers

A:

This predicts that the snippet prints 'false', but executing the displayed Python 3 codeprints 'true'. IndexError and KeyError are distinct subclasses of LookupError and can be caught by its common superclass.

B:

This predicts that the snippet prints '1', but executing the displayed Python 3 codeprints 'true'. IndexError and KeyError are distinct subclasses of LookupError and can be caught by its common superclass.

C:

This predicts that the snippet prints '0', but executing the displayed Python 3 codeprints 'true'. IndexError and KeyError are distinct subclasses of LookupError and can be caught by its common superclass.

Question 366

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

  1. IndexError and KeyError are distinct subclasses of LookupError and can be caught by its common superclass.
  2. ZeroDivisionError inherits from ArithmeticError which itself inherits from Exception.
  3. A global declaration makes assignment inside the function modify the module-level name.
  4. An except block for an unrelated exception does not intercept the error and execution fails at the uncaught exception.

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 ArithmeticError inheritance. It does not account for this example, whose result isprints 'true'. The relevant rule is: IndexError and KeyError are distinct subclasses of LookupError and can be caught by its common superclass.

C:

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: IndexError and KeyError are distinct subclasses of LookupError and can be caught by its common superclass.

D:

That statement describes the separate topic specific versus incorrect exception catch. It does not account for this example, whose result isprints 'true'. The relevant rule is: IndexError and KeyError are distinct subclasses of LookupError and can be caught by its common superclass.

Question 367

A learner is checking LookupError ancestry. After this modification, what does Python 3 actually do?print(issubclass(ValueError,LookupError))

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

Explanation

Correct Answer

A:

The snippet prints 'false'. IndexError and KeyError are distinct subclasses of LookupError and can be caught by its common superclass.

Incorrect Answers

B:

This predicts that the snippet prints '1', but executing the displayed Python 3 code prints 'false'. IndexError and KeyError are distinct subclasses of LookupError and can be caught by its common superclass.

C:

This predicts that the snippet prints '0', but executing the displayed Python 3 code prints 'false'. IndexError and KeyError are distinct subclasses of LookupError and can be caught by its common superclass.

D:

This predicts that the snippetprints 'true', but executing the displayed Python 3 code prints 'false'. IndexError and KeyError are distinct subclasses of LookupError and can be caught by its common superclass.

Question 368

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

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

Explanation

Correct Answers

A:

Running Program Aprints 'true'. IndexError and KeyError are distinct subclasses of LookupError and can be caught by its common superclass.

C:

Running Program Cprints 'true'. IndexError and KeyError are distinct subclasses of LookupError and can be caught by its common superclass.

F:

Running Program B prints 'false'. IndexError and KeyError are distinct subclasses of LookupError and can be caught by its common superclass.

Incorrect Answers

B:

Program C does not produce 'none'; its verified result is:prints 'True'. IndexError and KeyError are distinct subclasses of LookupError and can be caught by its common superclass.

D:

Program A does not produce 'even'; its verified result is:prints 'True'. IndexError and KeyError are distinct subclasses of LookupError and can be caught by its common superclass.

E:

Program B does not produce 'index'; its verified result is: Prints 'False'. IndexError and KeyError are distinct subclasses of LookupError and can be caught by its common superclass.

Question 369

A learner is checking ArithmeticError inheritance. What is the exact printed result or uncaught exception?print(issubclass(ZeroDivisionError,ArithmeticError))

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

Explanation

Correct Answer

B:

The snippetprints 'true'. ZeroDivisionError inherits from ArithmeticError which itself inherits from Exception.

Incorrect Answers

A:

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

C:

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

D:

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

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.

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.