PCEP-30-02 — Free Practice Questions
10 free sample questions from a bank of 396, with the correct answers and explanations. No signup required — start practising right now.
1Insert the correct snippet so that the program produces the expected output.
Expected output: Code:

- b = 0 not in list
- b = list[0]
- b = 0 in list
- b = False
Answer: C
2What will be the output of the following code snippet?
Answer: C
3What is the output of the following snippet?
- two
- one
- (‘one’, ‘two’, ‘three’)
- three
Answer: A
4What is the expected output of the following code?
- [3, 1, 25, 5, 20, 5, 4]
- [1, 3, 4, 5, 20, 5, 25]
- [3, 5, 20, 5, 25, 1, 3]
- [1, 3, 3, 4, 5, 5, 20, 25]
- [3, 4, 5, 20, 5, 25, 1, 3]
Answer: C
5Which of the following sentences is true?
- str1 and str2 are different (but equal) strings.
- str1 and str2 are different names of the same strings.
- str1 is longer than str2
- str2 is longer than str1
Answer: A
6The fact that tuples belong to sequence types means:
- they can be modified using the del instruction
- they can be extended using the .append() method
- they are actually lists
- they can be indexed and sliced like lists
Answer: D
7What is the output of the following code?
- [1, 1, 1]
- [3, -1, 1]
- [3, 1, 1]
Answer: C
8Assuming that the tuple is a correctly created tuple, the fact that tuples are immutable means that the following instruction:
- is illegal
- may be illegal if the tuple contains strings
- can be executed if and only if the tuple contains at least two elements
- is fully correct
Answer: A
9A data structure described as LIFO is actually a:
Answer: A
10How would you remove all the items from the d dictionary?
Expected output: Code:

- d.del()
- d.remove()
- del d
- d.clear()
Answer: D
Want the full bank of 396 questions for PCEP-30-02? See all practice exams.