PCEP-30-02 Practice Test

PCEP-30-02 Practice Test practice questions, page 4 of 20, with answer review and explanations.

Question 16

What is the expected output of the following code?

  1. The code is erroneous.
  2. 6
  3. 5
  4. 4

Question 17

What is the expected output of the following code?

  1. ('Peter': 30, 'Paul': 31)
  2. ('Peter', 'Paul')
  3. ['Peter': 30, 'Paul': 31]
  4. ['Peter', 'Paul']

Question 18

What is the output of the following snippet?

  1. 2
  2. 4
  3. The snippet is erroneous (invalid syntax)

Question 19

What is the expected output of the following code?

  1. (4)
  2. 4
  3. (4,)
  4. 44

Question 20

What is the output of the following snippet?

  1. [1, 1, 2, 2]
  2. [1, 1, 1, 2]
  3. [1, 2, 1, 2]
  4. [1, 2, 2, 2]