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 5

Question 40

During a review of right-associative exponentiation, three independent Python 3 fragments are shown. Which TWO statements accurately describe their behavior? (Choose TWO.)Program A: print((2**3)**2) Program B: print(3**2**2) Program C: print(4**(1+1))

  1. Program B prints '81'.
  2. Program C prints '14'.
  3. Program C prints '16'.
  4. Program A prints '-3'.
  5. Program B prints '-2'.

Explanation

Correct Answers

A:

Running Program B prints '81'. A chain of exponentiation operators groups from the right unless parentheses explicitly change the grouping.

C:

Running Program C prints '16'. A chain of exponentiation operators groups from the right unless parentheses explicitly change the grouping.

Incorrect Answers

B:

Program C does not produce '14'; its verified result is: Prints '16'. A chain of exponentiation operators groups from the right unless parentheses explicitly change the grouping.

D:

Program A does not produce '-3'; its verified result is: Prints '64'. A chain of exponentiation operators groups from the right unless parentheses explicitly change the grouping.

E:

Program B does not produce '-2'; its verified result is: Prints '81'. A chain of exponentiation operators groups from the right unless parentheses explicitly change the grouping.

Question 41

A learner is checking unary minus relative to exponentiation. What is the exact printed result or uncaught exception?print(-2**2)

  1. Prints '-3'
  2. Prints '-5'
  3. Prints '-2'
  4. Prints '-4'

Explanation

Correct Answer

D:

The snippet prints '-4'. Exponentiation binds before a leading unary minus, so -a**b negates the power rather than the base.

Incorrect Answers

A:

This predicts that the snippet prints '-3', but executing the displayed Python 3 code prints '-4'. Exponentiation binds before a leading unary minus, so -a**b negates the power rather than the base.

B:

This predicts that the snippet prints '-5', but executing the displayed Python 3 code prints '-4'. Exponentiation binds before a leading unary minus, so -a**b negates the power rather than the base.

C:

This predicts that the snippet prints '-2', but executing the displayed Python 3 code prints '-4'. Exponentiation binds before a leading unary minus, so -a**b negates the power rather than the base.

Question 42

A developer tests unary minus relative to exponentiation. The following code prints '4'. Which explanation best accounts for that observed behavior?print((-2)**2)

  1. The and and or operators short-circuit and return operands, not necessarily Boolean objects.
  2. Exponentiation binds before a leading unary minus, so -a**b negates the power rather than the base.
  3. Indentation determines which statements are inside a Python suite; dedented statements run afterward.
  4. Boolean True and False behave as integer one and zero in Python arithmetic while remaining Boolean values.

Explanation

Correct Answer

B:

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

Incorrect Answers

A:

The short-circuit Boolean expressions topic does not explain why the code prints '4'. The relevant Python rule is: Exponentiation binds before a leading unary minus, so -a**b negates the power rather than the base.

C:

The indentation-defined code blocks topic does not explain why the code prints '4'. The relevant Python rule is: Exponentiation binds before a leading unary minus, so -a**b negates the power rather than the base.

D:

The Boolean literals in numeric expressions topic does not explain why the code prints '4'. The relevant Python rule is: Exponentiation binds before a leading unary minus, so -a**b negates the power rather than the base.

Question 43

A learner is checking unary minus relative to exponentiation. After this modification, what does Python 3 actually do?print(-3**3)

  1. Prints '-25'
  2. Prints '-26'
  3. Prints '-28'
  4. Prints '-27'

Explanation

Correct Answer

D:

The snippet prints '-27'. Exponentiation binds before a leading unary minus, so -a**b negates the power rather than the base.

Incorrect Answers

A:

This predicts that the snippet prints '-25', but executing the displayed Python 3 code prints '-27'. Exponentiation binds before a leading unary minus, so -a**b negates the power rather than the base.

B:

This predicts that the snippet prints '-26', but executing the displayed Python 3 code prints '-27'. Exponentiation binds before a leading unary minus, so -a**b negates the power rather than the base.

C:

This predicts that the snippet prints '-28', but executing the displayed Python 3 code prints '-27'. Exponentiation binds before a leading unary minus, so -a**b negates the power rather than the base.

Question 44

During a review of unary minus relative to exponentiation, three independent Python 3 fragments are shown. Which TWO statements accurately describe their behavior? (Choose TWO.)Program A: print((-2)**2) Program B: print(-3**3) Program C: print(-2**3+1)

  1. Program C prints '-7'.
  2. Program B prints '-27'.
  3. Program A prints '6'.
  4. Program B prints '123'.
  5. Program C prints '16'.

Explanation

Correct Answers

A:

Running Program C prints '-7'. Exponentiation binds before a leading unary minus, so -a**b negates the power rather than the base.

B:

Running Program B prints '-27'. Exponentiation binds before a leading unary minus, so -a**b negates the power rather than the base.

Incorrect Answers

C:

Program A does not produce '6'; its verified result is: Prints '4'. Exponentiation binds before a leading unary minus, so -a**b negates the power rather than the base.

D:

Program B does not produce '123'; its verified result is: Prints '-27'. Exponentiation binds before a leading unary minus, so -a**b negates the power rather than the base.

E:

Program C does not produce '16'; its verified result is: Prints '-7'. Exponentiation binds before a leading unary minus, so -a**b negates the power rather than the base.

Question 45

A learner is checking true division versus floor division. What is the exact printed result or uncaught exception?print(7/2,7//2)

  1. Prints '3.5 3?'
  2. Prints '3 5.3'
  3. Prints '3.5 '
  4. Prints '3.5 3'

Explanation

Correct Answer

D:

The snippet prints '3.5 3'. The / operator returns a float whereas // floors the quotient toward negative infinity.

Incorrect Answers

A:

This predicts that the snippet prints '3.5 3?', but executing the displayed Python 3 code prints '3.5 3'. The / operator returns a float whereas // floors the quotient toward negative infinity.

B:

This predicts that the snippet prints '3 5.3', but executing the displayed Python 3 code prints '3.5 3'. The / operator returns a float whereas // floors the quotient toward negative infinity.

C:

This predicts that the snippet prints '3.5 ', but executing the displayed Python 3 code prints '3.5 3'. The / operator returns a float whereas // floors the quotient toward negative infinity.

Question 46

A developer tests true division versus floor division. The following code prints '-4'. Which explanation best accounts for that observed behavior?print(-7//2)

  1. The / operator returns a float whereas // floors the quotient toward negative infinity.
  2. Bitwise operations work on integer bits: & keeps common set bits, | combines them, and shifts move bit positions.
  3. Prefix 0b, 0o and 0x specifies the base of an integer literal, and mixed-base arithmetic uses numeric values.
  4. The sep parameter joins print arguments, and end replaces the trailing newline emitted by print.

Explanation

Correct Answer

A:

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

Incorrect Answers

B:

The bitwise masking and shifts topic does not explain why the code prints '-4'. The relevant Python rule is: The / operator returns a float whereas // floors the quotient toward negative infinity.

C:

The binary octal and hexadecimal integer literals topic does not explain why the code prints '-4'. The relevant Python rule is: The / operator returns a float whereas // floors the quotient toward negative infinity.

D:

The print separators and line endings topic does not explain why the code prints '-4'. The relevant Python rule is: The / operator returns a float whereas // floors the quotient toward negative infinity.

Question 47

A learner is checking true division versus floor division. After this modification, what does Python 3 actually do?print(8//3,8/3)

  1. Prints '5666666666666666.2 2'
  2. Prints '2 2.666666666666666'
  3. Prints '2 2.6666666666666665'
  4. Prints '2 2.6666666666666665?'

Explanation

Correct Answer

C:

The snippet prints '2 2.6666666666666665'. The / operator returns a float whereas // floors the quotient toward negative infinity.

Incorrect Answers

A:

This predicts that the snippet prints '5666666666666666.2 2', but executing the displayed Python 3 code prints '2 2.6666666666666665'. The / operator returns a float whereas // floors the quotient toward negative infinity.

B:

This predicts that the snippet prints '2 2.666666666666666', but executing the displayed Python 3 code prints '2 2.6666666666666665'. The / operator returns a float whereas // floors the quotient toward negative infinity.

D:

This predicts that the snippet prints '2 2.6666666666666665?', but executing the displayed Python 3 code prints '2 2.6666666666666665'. The / operator returns a float whereas // floors the quotient toward negative infinity.

Question 48

During a review of true division versus floor division, three independent Python 3 fragments are shown. Which THREE statements accurately describe their behavior? (Choose THREE.)Program A: print(-7//2) Program B: print(8//3,8/3) Program C: print(5//-2)

  1. Program B prints '# not a comment'.
  2. Program A prints '14'.
  3. Program C prints '-3'.
  4. Program C prints '64'.
  5. Program A prints '-4'.
  6. Program B prints '2 2.6666666666666665'.

Explanation

Correct Answers

C:

Running Program C prints '-3'. The / operator returns a float whereas // floors the quotient toward negative infinity.

E:

Running Program A prints '-4'. The / operator returns a float whereas // floors the quotient toward negative infinity.

F:

Running Program B prints '2 2.6666666666666665'. The / operator returns a float whereas // floors the quotient toward negative infinity.

Incorrect Answers

A:

Program B does not produce '# not a comment'; its verified result is: Prints '2 2.6666666666666665'. The / operator returns a float whereas // floors the quotient toward negative infinity.

B:

Program A does not produce '14'; its verified result is: Prints '-4'. The / operator returns a float whereas // floors the quotient toward negative infinity.

D:

Program C does not produce '64'; its verified result is: Prints '-3'. The / operator returns a float whereas // floors the quotient toward negative infinity.

Question 49

A learner is checking modulo with a negative divisor. What is the exact printed result or uncaught exception?print(-7%3)

  1. Prints '4'
  2. Prints '2'
  3. Prints '1'
  4. Prints '3'

Explanation

Correct Answer

B:

The snippet prints '2'. For integers, a == (a // b) * b + (a % b); the modulo result has the divisor sign when nonzero.

Incorrect Answers

A:

This predicts that the snippet prints '4', but executing the displayed Python 3 code prints '2'. For integers, a == (a // b) * b + (a % b); the modulo result has the divisor sign when nonzero.

C:

This predicts that the snippet prints '1', but executing the displayed Python 3 code prints '2'. For integers, a == (a // b) * b + (a % b); the modulo result has the divisor sign when nonzero.

D:

This predicts that the snippet prints '3', but executing the displayed Python 3 code prints '2'. For integers, a == (a // b) * b + (a % b); the modulo result has the divisor sign when nonzero.

Question 50

A developer tests modulo with a negative divisor. The following code prints '-2'. Which explanation best accounts for that observed behavior?print(7%-3)

  1. Exponentiation binds before a leading unary minus, so -a**b negates the power rather than the base.
  2. input returns a string; numeric calculations require explicit int or float conversion when text is provided.
  3. Python identifiers distinguish lowercase and uppercase letters; names that differ in case are different bindings.
  4. For integers, a == (a // b) * b + (a % b); the modulo result has the divisor sign when nonzero.

Explanation

Correct Answer

D:

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

Incorrect Answers

A:

The unary minus relative to exponentiation topic does not explain why the code prints '-2'. The relevant Python rule is: For integers, a == (a // b) * b + (a % b); the modulo result has the divisor sign when nonzero.

B:

The input strings and explicit conversion topic does not explain why the code prints '-2'. The relevant Python rule is: For integers, a == (a // b) * b + (a % b); the modulo result has the divisor sign when nonzero.

C:

The case-sensitive identifiers topic does not explain why the code prints '-2'. The relevant Python rule is: For integers, a == (a // b) * b + (a % b); the modulo result has the divisor sign when nonzero.

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.