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 6

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.

Question 51

A learner is checking modulo with a negative divisor. After this modification, what does Python 3 actually do?print(-7//3,-7%3)

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

Explanation

Correct Answer

C:

The snippet prints '-3 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 '-3 ', but executing the displayed Python 3 code prints '-3 2'. For integers, a == (a // b) * b + (a % b); the modulo result has the divisor sign when nonzero.

B:

This predicts that the snippet prints '-3 2?', but executing the displayed Python 3 code prints '-3 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 '2 3-', but executing the displayed Python 3 code prints '-3 2'. For integers, a == (a // b) * b + (a % b); the modulo result has the divisor sign when nonzero.

Question 52

During a review of modulo with a negative divisor, three independent Python 3 fragments are shown. Which THREE statements accurately describe their behavior? (Choose THREE.)Program A: print(7%-3) Program B: print(-7//3,-7%3) Program C: print(13%5)

  1. Program B prints 'goal'.
  2. Program A prints '-2'.
  3. Program A prints '64'.
  4. Program C prints '3'.
  5. Program B prints '-3 2'.
  6. Program C prints '1'.

Explanation

Correct Answers

B:

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

D:

Running Program C prints '3'. For integers, a == (a // b) * b + (a % b); the modulo result has the divisor sign when nonzero.

E:

Running Program B prints '-3 2'. For integers, a == (a // b) * b + (a % b); the modulo result has the divisor sign when nonzero.

Incorrect Answers

A:

Program B does not produce 'goal'; its verified result is: Prints '-3 2'. For integers, a == (a // b) * b + (a % b); the modulo result has the divisor sign when nonzero.

C:

Program A does not produce '64'; its verified result is: Prints '-2'. For integers, a == (a // b) * b + (a % b); the modulo result has the divisor sign when nonzero.

F:

Program C does not produce '1'; its verified result is: Prints '3'. For integers, a == (a // b) * b + (a % b); the modulo result has the divisor sign when nonzero.

Question 53

A learner is checking multiplication and addition precedence. What is the exact printed result or uncaught exception?print(2+3*4)

  1. Prints '14'
  2. Prints '13'
  3. Prints '15'
  4. Prints '16'

Explanation

Correct Answer

A:

The snippet prints '14'. Multiplication and division bind before addition and subtraction unless parentheses override precedence.

Incorrect Answers

B:

This predicts that the snippet prints '13', but executing the displayed Python 3 code prints '14'. Multiplication and division bind before addition and subtraction unless parentheses override precedence.

C:

This predicts that the snippet prints '15', but executing the displayed Python 3 code prints '14'. Multiplication and division bind before addition and subtraction unless parentheses override precedence.

D:

This predicts that the snippet prints '16', but executing the displayed Python 3 code prints '14'. Multiplication and division bind before addition and subtraction unless parentheses override precedence.

Question 54

A developer tests multiplication and addition precedence. The following code prints '20'. Which explanation best accounts for that observed behavior?print((2+3)*4)

  1. Prefix 0b, 0o and 0x specifies the base of an integer literal, and mixed-base arithmetic uses numeric values.
  2. Multiplication and division bind before addition and subtraction unless parentheses override precedence.
  3. A # outside a string begins a comment and does not change the preceding executable expression.
  4. Python identifiers distinguish lowercase and uppercase letters; names that differ in case are different bindings.

Explanation

Correct Answer

B:

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

Incorrect Answers

A:

The binary octal and hexadecimal integer literals topic does not explain why the code prints '20'. The relevant Python rule is: Multiplication and division bind before addition and subtraction unless parentheses override precedence.

C:

The comments and executable code topic does not explain why the code prints '20'. The relevant Python rule is: Multiplication and division bind before addition and subtraction unless parentheses override precedence.

D:

The case-sensitive identifiers topic does not explain why the code prints '20'. The relevant Python rule is: Multiplication and division bind before addition and subtraction unless parentheses override precedence.

Question 55

A learner is checking multiplication and addition precedence. After this modification, what does Python 3 actually do?print(19-8/2)

  1. Prints '17.0'
  2. Prints '16.0'
  3. Prints '15.0'
  4. Prints '14.0'

Explanation

Correct Answer

C:

The snippet prints '15.0'. Multiplication and division bind before addition and subtraction unless parentheses override precedence.

Incorrect Answers

A:

This predicts that the snippet prints '17.0', but executing the displayed Python 3 code prints '15.0'. Multiplication and division bind before addition and subtraction unless parentheses override precedence.

B:

This predicts that the snippet prints '16.0', but executing the displayed Python 3 code prints '15.0'. Multiplication and division bind before addition and subtraction unless parentheses override precedence.

D:

This predicts that the snippet prints '14.0', but executing the displayed Python 3 code prints '15.0'. Multiplication and division bind before addition and subtraction unless parentheses override precedence.

Question 56

During a review of multiplication and addition precedence, three independent Python 3 fragments are shown. Which THREE statements accurately describe their behavior? (Choose THREE.)Program A: print((2+3)*4) Program B: print(19-8/2) Program C: print(6+12//4*2)

  1. Program A prints '-4'.
  2. Program C prints '12'.
  3. Program C prints '14'.
  4. Program A prints '20'.
  5. Program B prints '15.0'.
  6. Program B prints '0\n2'.

Explanation

Correct Answers

B:

Running Program C prints '12'. Multiplication and division bind before addition and subtraction unless parentheses override precedence.

D:

Running Program A prints '20'. Multiplication and division bind before addition and subtraction unless parentheses override precedence.

E:

Running Program B prints '15.0'. Multiplication and division bind before addition and subtraction unless parentheses override precedence.

Incorrect Answers

A:

Program A does not produce '-4'; its verified result is: Prints '20'. Multiplication and division bind before addition and subtraction unless parentheses override precedence.

C:

Program C does not produce '14'; its verified result is: Prints '12'. Multiplication and division bind before addition and subtraction unless parentheses override precedence.

F:

Program B does not produce '0\n2'; its verified result is: Prints '15.0'. Multiplication and division bind before addition and subtraction unless parentheses override precedence.

Question 57

A learner is checking bitwise masking and shifts. What is the exact printed result or uncaught exception?print(0b1101 & 0b1011)

  1. Prints '11'
  2. Prints '8'
  3. Prints '9'
  4. Prints '10'

Explanation

Correct Answer

C:

The snippet prints '9'. Bitwise operations work on integer bits: & keeps common set bits, | combines them, and shifts move bit positions.

Incorrect Answers

A:

This predicts that the snippet prints '11', but executing the displayed Python 3 code prints '9'. Bitwise operations work on integer bits: & keeps common set bits, | combines them, and shifts move bit positions.

B:

This predicts that the snippet prints '8', but executing the displayed Python 3 code prints '9'. Bitwise operations work on integer bits: & keeps common set bits, | combines them, and shifts move bit positions.

D:

This predicts that the snippet prints '10', but executing the displayed Python 3 code prints '9'. Bitwise operations work on integer bits: & keeps common set bits, | combines them, and shifts move bit positions.

Question 58

A developer tests bitwise masking and shifts. The following code prints '7'. Which explanation best accounts for that observed behavior?print(5 | 2)

  1. The sep parameter joins print arguments, and end replaces the trailing newline emitted by print.
  2. Multiplication and division bind before addition and subtraction unless parentheses override precedence.
  3. The and and or operators short-circuit and return operands, not necessarily Boolean objects.
  4. Bitwise operations work on integer bits: & keeps common set bits, | combines them, and shifts move bit positions.

Explanation

Correct Answer

D:

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

Incorrect Answers

A:

The print separators and line endings topic does not explain why the code prints '7'. The relevant Python rule is: Bitwise operations work on integer bits: & keeps common set bits, | combines them, and shifts move bit positions.

B:

The multiplication and addition precedence topic does not explain why the code prints '7'. The relevant Python rule is: Bitwise operations work on integer bits: & keeps common set bits, | combines them, and shifts move bit positions.

C:

The short-circuit Boolean expressions topic does not explain why the code prints '7'. The relevant Python rule is: Bitwise operations work on integer bits: & keeps common set bits, | combines them, and shifts move bit positions.

Question 59

A learner is checking bitwise masking and shifts. After this modification, what does Python 3 actually do?print(3<<2)

  1. Prints '11'
  2. Prints '13'
  3. Prints '14'
  4. Prints '12'

Explanation

Correct Answer

D:

The snippet prints '12'. Bitwise operations work on integer bits: & keeps common set bits, | combines them, and shifts move bit positions.

Incorrect Answers

A:

This predicts that the snippet prints '11', but executing the displayed Python 3 code prints '12'. Bitwise operations work on integer bits: & keeps common set bits, | combines them, and shifts move bit positions.

B:

This predicts that the snippet prints '13', but executing the displayed Python 3 code prints '12'. Bitwise operations work on integer bits: & keeps common set bits, | combines them, and shifts move bit positions.

C:

This predicts that the snippet prints '14', but executing the displayed Python 3 code prints '12'. Bitwise operations work on integer bits: & keeps common set bits, | combines them, and shifts move bit positions.

Question 60

During a review of bitwise masking and shifts, three independent Python 3 fragments are shown. Which THREE statements accurately describe their behavior? (Choose THREE.)Program A: print(5 | 2) Program B: print(3<<2) Program C: print(12>>2 ^ 1)

  1. Program A prints '7'.
  2. Program B prints '12'.
  3. Program A prints '5'.
  4. Program B prints '16'.
  5. Program C prints '2'.
  6. Program C prints '4'.

Explanation

Correct Answers

A:

Running Program A prints '7'. Bitwise operations work on integer bits: & keeps common set bits, | combines them, and shifts move bit positions.

B:

Running Program B prints '12'. Bitwise operations work on integer bits: & keeps common set bits, | combines them, and shifts move bit positions.

E:

Running Program C prints '2'. Bitwise operations work on integer bits: & keeps common set bits, | combines them, and shifts move bit positions.

Incorrect Answers

C:

Program A does not produce '5'; its verified result is: Prints '7'. Bitwise operations work on integer bits: & keeps common set bits, | combines them, and shifts move bit positions.

D:

Program B does not produce '16'; its verified result is: Prints '12'. Bitwise operations work on integer bits: & keeps common set bits, | combines them, and shifts move bit positions.

F:

Program C does not produce '4'; its verified result is: Prints '2'. Bitwise operations work on integer bits: & keeps common set bits, | combines them, and shifts move bit positions.

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.