Free PCEP-30-02 Exam Braindumps (page: 18)

Page 17 of 99

You develop a Python application for your company.
A list named employees contains 200 employee names, the last five being company management. You need to slice the list to display all employees excluding management.
Which code segments can you use? (Choose two.)

  1. employees[1:-5]
  2. employees[0:-5]
  3. employees[:-5]
  4. employees[0:-4]
  5. employees[1:-4]

Answer(s): B,C



What is the expected output of the following code?

  1. 1 1 2 3 4 5
  2. 2 3 4 5 6 1
  3. 2 3 4 5 6 6
  4. 1 2 3 4 5 6

Answer(s): C



What is the expected output of the following code?

  1. [1, 10, 3, 20, 5, 30, 7, 40, 9, 50, 60]
  2. [1, 2, 10, 20, 30, 40, 50, 60]
  3. The code is erroneous.
  4. [10, 2, 20, 4, 30, 6, 40, 8, 50, 60]

Answer(s): C



What is the expected output of the following code?

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

Answer(s): C






Post your Comments and Discuss Python Institute PCEP-30-02 exam with other Community members:

PCEP-30-02 Discussions & Posts