📘 Free PCEP-30-02 Sample Questions
Try these real exam-style questions before you start your full practice.
Insert the correct snippet so that the program produces the expected output.
Expected output:
A
b = 0 not in list
B
b = list[0]
C
. b = 0 in list
D
. b = False
Correct Answer:
C. . b = 0 in list
Assuming that the tuple is a correctly created tuple, the fact that tuples are immutable means that the following
instruction:
A
is illegal
B
may be illegal if the tuple contains strings
C
can be executed if and only if the tuple contains at least two elements
D
is fully correct
Correct Answer:
A. is illegal
What is the expected output of the following code?
A
2
B
4
C
5
D
3
Correct Answer:
B. 4
What is the expected output of the following code?
A
[1, 3]
B
[1, 4]
C
. [4, 3]
D
. [1, 3, 4]
Correct Answer:
C. . [4, 3]
What is the expected output of the following code?
A
['Peter', 404, 3.03, 'Wellert', 33.3]
B
None of the above.
C
[404, 3.03]
D
. ['Peter', 'Wellert']
Correct Answer:
C. [404, 3.03]
Take a look at the snippet, and choose the true statements: (Choose two.)
A
nums is longer than vals
B
nums and vals are of the same length
C
. vals is longer than nums
D
nums and vals refer to the same list
Correct Answer:
B. nums and vals are of the same length
What is the output of the following snippet?
A
12
B
(2, 1)
C
(1, 2)
D
21
Correct Answer:
D. 21
What is the expected output of the following code?
print(list('hello'))
A
hello
B
[h, e, l, l, o]
C
['h', 'e', 'l', 'l', 'o']
D
. ['h' 'e' 'l' 'l' 'o']
E
None of the above.
Correct Answer:
C. ['h', 'e', 'l', 'l', 'o']
What will be the output of the following code snippet?
A
[1, 3, 5, 7, 9]
B
. [8, 9]
C
. [1, 2, 3]
D
[1, 2]
Correct Answer:
A. [1, 3, 5, 7, 9]
What will be the output of the following code snippet?
A
3
B
2
C
4
D
1
Correct Answer:
C. 4
Questions: 1-10 out of 418
Continue Full Practice..
GET ALL 418 QUESTIONS