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 3

Question 20

During a review of Boolean literals in numeric expressions, three independent Python 3 fragments are shown. Which TWO statements accurately describe their behavior? (Choose TWO.)Program A: print(False*9+4) Program B: print(True==1) Program C: print(type(True).__name__)

  1. Program B prints '0\n2'.
  2. Program B prints 'true'.
  3. Program C prints '4\n9'.
  4. Program C prints 'bool'.
  5. Program A prints '7'.

Explanation

Correct Answers

B:

Running Program Bprints 'true'. Boolean True and False behave as integer one and zero in Python arithmetic while remaining Boolean values.

D:

Running Program C prints 'bool'. Boolean True and False behave as integer one and zero in Python arithmetic while remaining Boolean values.

Incorrect Answers

A:

Program B does not produce '0\n2'; its verified result is:prints 'True'. Boolean True and False behave as integer one and zero in Python arithmetic while remaining Boolean values.

C:

Program C does not produce '4\n9'; its verified result is: Prints 'bool'. Boolean True and False behave as integer one and zero in Python arithmetic while remaining Boolean values.

E:

Program A does not produce '7'; its verified result is: Prints '4'. Boolean True and False behave as integer one and zero in Python arithmetic while remaining Boolean values.

Question 21

A learner is checking binary octal and hexadecimal integer literals. What is the exact printed result or uncaught exception?print(0b101+0xA)

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

Explanation

Correct Answer

C:

The snippet prints '15'. Prefix 0b, 0o and 0x specifies the base of an integer literal, and mixed-base arithmetic uses numeric values.

Incorrect Answers

A:

This predicts that the snippet prints '17', but executing the displayed Python 3 code prints '15'. Prefix 0b, 0o and 0x specifies the base of an integer literal, and mixed-base arithmetic uses numeric values.

B:

This predicts that the snippet prints '14', but executing the displayed Python 3 code prints '15'. Prefix 0b, 0o and 0x specifies the base of an integer literal, and mixed-base arithmetic uses numeric values.

D:

This predicts that the snippet prints '16', but executing the displayed Python 3 code prints '15'. Prefix 0b, 0o and 0x specifies the base of an integer literal, and mixed-base arithmetic uses numeric values.

Question 22

A developer tests binary octal and hexadecimal integer literals. The following code prints '12'. Which explanation best accounts for that observed behavior?print(0o17-0b11)

  1. Assignment rebinds a variable name to a new object; the new value determines later operations and its type.
  2. input returns a string; numeric calculations require explicit int or float conversion when text is provided.
  3. Indentation determines which statements are inside a Python suite; dedented statements run afterward.
  4. Prefix 0b, 0o and 0x specifies the base of an integer literal, and mixed-base arithmetic uses numeric values.

Explanation

Correct Answer

D:

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

Incorrect Answers

A:

The variable rebinding across types topic does not explain why the code prints '12'. The relevant Python rule is: Prefix 0b, 0o and 0x specifies the base of an integer literal, and mixed-base arithmetic uses numeric values.

B:

The input strings and explicit conversion topic does not explain why the code prints '12'. The relevant Python rule is: Prefix 0b, 0o and 0x specifies the base of an integer literal, and mixed-base arithmetic uses numeric values.

C:

The indentation-defined code blocks topic does not explain why the code prints '12'. The relevant Python rule is: Prefix 0b, 0o and 0x specifies the base of an integer literal, and mixed-base arithmetic uses numeric values.

Question 23

A learner is checking binary octal and hexadecimal integer literals. After this modification, what does Python 3 actually do?print(0x10//0b100)

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

Explanation

Correct Answer

A:

The snippet prints '4'. Prefix 0b, 0o and 0x specifies the base of an integer literal, and mixed-base arithmetic uses numeric values.

Incorrect Answers

B:

This predicts that the snippet prints '6', but executing the displayed Python 3 code prints '4'. Prefix 0b, 0o and 0x specifies the base of an integer literal, and mixed-base arithmetic uses numeric values.

C:

This predicts that the snippet prints '5', but executing the displayed Python 3 code prints '4'. Prefix 0b, 0o and 0x specifies the base of an integer literal, and mixed-base arithmetic uses numeric values.

D:

This predicts that the snippet prints '3', but executing the displayed Python 3 code prints '4'. Prefix 0b, 0o and 0x specifies the base of an integer literal, and mixed-base arithmetic uses numeric values.

Question 24

During a review of binary octal and hexadecimal integer literals, three independent Python 3 fragments are shown. Which TWO statements accurately describe their behavior? (Choose TWO.)Program A: print(0o17-0b11) Program B: print(0x10//0b100) Program C: print(0o12==0xA)

  1. Program B prints '4'.
  2. Program C prints 'true'.
  3. Program A prints '14'.
  4. Program C prints 'bool'.
  5. Program B prints '0'.

Explanation

Correct Answers

A:

Running Program B prints '4'. Prefix 0b, 0o and 0x specifies the base of an integer literal, and mixed-base arithmetic uses numeric values.

B:

Running Program Cprints 'true'. Prefix 0b, 0o and 0x specifies the base of an integer literal, and mixed-base arithmetic uses numeric values.

Incorrect Answers

C:

Program A does not produce '14'; its verified result is: Prints '12'. Prefix 0b, 0o and 0x specifies the base of an integer literal, and mixed-base arithmetic uses numeric values.

D:

Program C does not produce 'bool'; its verified result is:prints 'True'. Prefix 0b, 0o and 0x specifies the base of an integer literal, and mixed-base arithmetic uses numeric values.

E:

Program B does not produce '0'; its verified result is: Prints '4'. Prefix 0b, 0o and 0x specifies the base of an integer literal, and mixed-base arithmetic uses numeric values.

Question 25

A learner is checking scientific notation and float results. What is the exact printed result or uncaught exception?print(2e2+5)

  1. Prints '206.0'
  2. Prints '205.0'
  3. Prints '204.0'
  4. Prints '207.0'

Explanation

Correct Answer

B:

The snippet prints '205.0'. An e-notation numeric literal produces a float whose exponent determines its decimal magnitude.

Incorrect Answers

A:

This predicts that the snippet prints '206.0', but executing the displayed Python 3 code prints '205.0'. An e-notation numeric literal produces a float whose exponent determines its decimal magnitude.

C:

This predicts that the snippet prints '204.0', but executing the displayed Python 3 code prints '205.0'. An e-notation numeric literal produces a float whose exponent determines its decimal magnitude.

D:

This predicts that the snippet prints '207.0', but executing the displayed Python 3 code prints '205.0'. An e-notation numeric literal produces a float whose exponent determines its decimal magnitude.

Question 26

A developer tests scientific notation and float results. The following code prints '7.0'. Which explanation best accounts for that observed behavior?print(3.5e1/5)

  1. An e-notation numeric literal produces a float whose exponent determines its decimal magnitude.
  2. The / operator returns a float whereas // floors the quotient toward negative infinity.
  3. Exponentiation binds before a leading unary minus, so -a**b negates the power rather than the base.
  4. Indentation determines which statements are inside a Python suite; dedented statements run afterward.

Explanation

Correct Answer

A:

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

Incorrect Answers

B:

The true division versus floor division topic does not explain why the code prints '7.0'. The relevant Python rule is: An e-notation numeric literal produces a float whose exponent determines its decimal magnitude.

C:

The unary minus relative to exponentiation topic does not explain why the code prints '7.0'. The relevant Python rule is: An e-notation numeric literal produces a float whose exponent determines its decimal magnitude.

D:

The indentation-defined code blocks topic does not explain why the code prints '7.0'. The relevant Python rule is: An e-notation numeric literal produces a float whose exponent determines its decimal magnitude.

Question 27

A learner is checking scientific notation and float results. After this modification, what does Python 3 actually do?print(type(7e0).__name__)

  1. Prints 'taolf'
  2. Prints 'float'
  3. Prints 'floa'
  4. Prints 'float?'

Explanation

Correct Answer

B:

The snippet prints 'float'. An e-notation numeric literal produces a float whose exponent determines its decimal magnitude.

Incorrect Answers

A:

This predicts that the snippet prints 'taolf', but executing the displayed Python 3 code prints 'float'. An e-notation numeric literal produces a float whose exponent determines its decimal magnitude.

C:

This predicts that the snippet prints 'floa', but executing the displayed Python 3 code prints 'float'. An e-notation numeric literal produces a float whose exponent determines its decimal magnitude.

D:

This predicts that the snippet prints 'float?', but executing the displayed Python 3 code prints 'float'. An e-notation numeric literal produces a float whose exponent determines its decimal magnitude.

Question 28

During a review of scientific notation and float results, three independent Python 3 fragments are shown. Which TWO statements accurately describe their behavior? (Choose TWO.)Program A: print(3.5e1/5) Program B: print(type(7e0).__name__) Program C: print(1.2e-1*10)

  1. Program C prints '1.2'.
  2. Program B prints 'float'.
  3. Program A prints '512'.
  4. Program C prints '8 3'.
  5. Program B prints '1|2|3'.

Explanation

Correct Answers

A:

Running Program C prints '1.2'. An e-notation numeric literal produces a float whose exponent determines its decimal magnitude.

B:

Running Program B prints 'float'. An e-notation numeric literal produces a float whose exponent determines its decimal magnitude.

Incorrect Answers

C:

Program A does not produce '512'; its verified result is: Prints '7.0'. An e-notation numeric literal produces a float whose exponent determines its decimal magnitude.

D:

Program C does not produce '8 3'; its verified result is: Prints '1.2'. An e-notation numeric literal produces a float whose exponent determines its decimal magnitude.

E:

Program B does not produce '1|2|3'; its verified result is: Prints 'float'. An e-notation numeric literal produces a float whose exponent determines its decimal magnitude.

Question 29

A learner is checking escaped newline and tab characters. What is the exact printed result or uncaught exception?print("a\nb")

  1. Prints 'b'
  2. Prints 'a'
  3. Prints 'b\na'
  4. Prints 'a\nb'

Explanation

Correct Answer

D:

The snippet prints 'a\nb'. Escape sequences such as \n and \t represent control characters inside strings rather than literal backslash-letter pairs.

Incorrect Answers

A:

This predicts that the snippet prints 'b', but executing the displayed Python 3 code prints 'a\nb'. Escape sequences such as \n and \t represent control characters inside strings rather than literal backslash-letter pairs.

B:

This predicts that the snippet prints 'a', but executing the displayed Python 3 code prints 'a\nb'. Escape sequences such as \n and \t represent control characters inside strings rather than literal backslash-letter pairs.

C:

This predicts that the snippet prints 'b\na', but executing the displayed Python 3 code prints 'a\nb'. Escape sequences such as \n and \t represent control characters inside strings rather than literal backslash-letter pairs.

Question 30

A developer tests escaped newline and tab characters. The following code prints '3'. Which explanation best accounts for that observed behavior?print(len("x\ty"))

  1. Escape sequences such as \n and \t represent control characters inside strings rather than literal backslash-letter pairs.
  2. Assignment rebinds a variable name to a new object; the new value determines later operations and its type.
  3. Boolean True and False behave as integer one and zero in Python arithmetic while remaining Boolean values.
  4. An e-notation numeric literal produces a float whose exponent determines its decimal magnitude.

Explanation

Correct Answer

A:

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

Incorrect Answers

B:

The variable rebinding across types topic does not explain why the code prints '3'. The relevant Python rule is: Escape sequences such as \n and \t represent control characters inside strings rather than literal backslash-letter pairs.

C:

The Boolean literals in numeric expressions topic does not explain why the code prints '3'. The relevant Python rule is: Escape sequences such as \n and \t represent control characters inside strings rather than literal backslash-letter pairs.

D:

The scientific notation and float results topic does not explain why the code prints '3'. The relevant Python rule is: Escape sequences such as \n and \t represent control characters inside strings rather than literal backslash-letter pairs.

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.