Free PCEP-30-02 Sample Questions — PCEP – Certified Entry-Level Python Programmer

Free PCEP-30-02 sample questions for the PCEP – Certified Entry-Level Python Programmer exam. No account required: study at your own pace.

Want an interactive quiz? Take the full PCEP-30-02 practice test

Looking for more? Click here to get the full PDF with 47+ practice questions for $10 for offline study and deeper preparation.

Question 1

What is the expected output of the following code? x = 1 + 1 // 2 + 1 / 2 + 2 print(x)

  • A. 3
  • B. 4.0
  • C. 4
  • D. 3.5
Show Answer
Correct Answer:
D. 3.5
Question 2

The result of the following addition: 123 + 0.0

  • A. cannot be evaluated
  • B. is equal to 123
  • C. is equal to 123.0
Show Answer
Correct Answer:
C. is equal to 123.0
Question 3

The fact that tuples belong to sequence types means:

  • A. they can be modified using the del instruction
  • B. they can be extended using the .append() method
  • C. they are actually lists
  • D. they can be indexed and sliced like lists
Show Answer
Correct Answer:
D. they can be indexed and sliced like lists
Question 4

What is the expected output of the following code? print(2 ** 3 ** 2 ** 1)

  • A. 64
  • B. 16
  • C. 128.0
  • D. The code is erroneous
  • E. 16.0
  • F. 512
Show Answer
Correct Answer:
F. 512
Question 5

The following statement ... assert x == 0

  • A. will stop the program if x is equal to 0
  • B. has no effect
  • C. is erroneous
  • D. will stop the program if x is not equal to 0
Show Answer
Correct Answer:
D. will stop the program if x is not equal to 0
Question 6

A variable defined outside a function:

  • A. may be read, but not written (something more is needed to do so)
  • B. may not be accessed in any way inside the function
  • C. may be freely accessed inside the function
Show Answer
Correct Answer:
A. may be read, but not written (something more is needed to do so)
Question 7

What is the expected output of the following code? print(chr(ord('z') - 2))

  • A. x
  • B. y
  • C. a
  • D. z
Show Answer
Correct Answer:
A. x
Question 8

What is the expected output of the following code? print('x', 'y', 'z', sep='sep')

  • A. x y z
  • B. xyz
  • C. xsepysepzsep
  • D. xsepysepz
Show Answer
Correct Answer:
D. xsepysepz
Question 9

If you want to build a string that reads: Peter's sister's name's "Anna" Which of the following literals would you use? (Choose two.)

  • A. 'Peter's sister's name's "Anna"'
  • B. 'Peter\'s sister\'s name\'s \"Anna\"'
  • C. "Peter's sister's name's "Anna""
  • D. "Peter's sister's name's \"Anna\""
Show Answer
Correct Answer:
  • B. 'Peter\'s sister\'s name\'s \"Anna\"'
  • D. "Peter's sister's name's \"Anna\""
Question 10

What is the expected output of the following code? print(1 // 2 * 3)

  • A. 4.5
  • B. 0.16666666666666666
  • C. 0.0
  • D. 0
Show Answer
Correct Answer:
D. 0
Question 11

What is the expected output of the following code? menu = {“bunuelo”: 3.21, “torrijas”: 4.99, “churros”: 1.99} for value in menu.values(): print (str(value) [1], end “”)

  • A. nru
  • B. The code is eeromeous and cannot be run
  • C. 3.214.991.99
  • D. ..
Show Answer
Correct Answer:
D. ..
Question 12

A data structure described as LIFO is actually a:

  • A. stack
  • B. tree
  • C. list
  • D. heap
Show Answer
Correct Answer:
A. stack
Question 13

Which of the following function calls can be used to invoke the below function definition? (Choose three.) def test(a, b, c, d):

  • A. test(a=1, b=2, c=3, 4)
  • B. test(1, 2, 3, d=4)
  • C. test(a=1, 2, 3, 4)
  • D. test(1, 2, 3, 4)
  • E. test(a=1, b=2, c=3, d=4)
  • F. test(a=1, 2, c=3, 4)
Show Answer
Correct Answer:
  • B. test(1, 2, 3, d=4)
  • D. test(1, 2, 3, 4)
  • E. test(a=1, b=2, c=3, d=4)
Question 14

What is the expected output of the following code? x = 1 / 2 + 3 // 3 + 4 ** 2 print(x)

  • A. 17
  • B. 17.5
  • C. 8.5
  • D. 8
Show Answer
Correct Answer:
B. 17.5
Question 15

The following code: print(float("1, 3"))

  • A. prints 13
  • B. prints 1.3
  • C. prints 1,3
  • D. raises a ValueError exception
Show Answer
Correct Answer:
D. raises a ValueError exception

Aced these? Get the Full Exam

Download the complete PCEP-30-02 study bundle with 47+ questions in a single printable PDF.