PCEP-30-02 Practice Test

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

Question 56

What is the expected output of the following code?

  1. 4
  2. 2
  3. 10
  4. 0
  5. 1
  6. 3

Question 57

What is the output of the following snippet?

  1. [0, 1, 9, 16]
  2. [0, 1, 4, 16]
  3. [0, 1, 4, 9]
  4. [1, 4, 9, 16]

Question 58

What is the expected output of the following code?

  1. [4, 3, 2, 1]
  2. [4, 3, 2]
  3. [4, 3]
  4. The code is erroneous.

Question 59

Take a look at the snippet and choose one of the following statements which is true:

  1. nums and vals are of the same length
  2. nums is longer than vals
  3. vals is longer than nums

Question 60

What is the expected output of the following code?

  1. 0 1
  2. 1 0
  3. The code is erroneous.
  4. 0 0