PCEP-30-02 Practice Test

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

Question 6

Take a look at the snippet, and choose the true statements: (Choose two.)

  1. nums is longer than vals
  2. nums and vals are of the same length
  3. vals is longer than nums
  4. nums and vals refer to the same list

Question 7

What is the output of the following snippet?

  1. 12
  2. (2, 1)
  3. (1, 2)
  4. 21

Question 8

What is the expected output of the following code? print(list('hello'))

  1. hello
  2. [h, e, l, l, o]
  3. ['h', 'e', 'l', 'l', 'o']
  4. ['h' 'e' 'l' 'l' 'o']
  5. None of the above.

Question 9

What will be the output of the following code snippet?

  1. [1, 3, 5, 7, 9]
  2. [8, 9]
  3. [1, 2, 3]
  4. [1, 2]

Question 10

What will be the output of the following code snippet?

  1. 3
  2. 2
  3. 4
  4. 1