Free PCEP-30-02 Practice Test Questions and Answers (2026) Practice Questions
Free preview: 20 questions.
Python PCEP 30 02
Q: 1
How can you assign number 1,000,000 (int type) to the variable in Python? (select 2)
Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 2
DRAG DROP Arrange the code boxes in the correct positions in order to obtain a loop which executes its body with the level variable going through values 5, 1, and 1 (in the same order). 
Drag & Drop
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 3
What will be the value of X in the following Python expression?
X = 2+9*((3*12)-8)/10
Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 4
DRAG DROP Drag and drop the code boxes in order to build a program which prints Unavailable to the screen. (Note: one code box will not be used.) 
Drag & Drop
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 5
The following variable was created:
course_name = 'python interview'
in a global scope. How can you remove this variable? (select 3)
Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 6
How many stars will the following code send to the monitor?
x = 0
while x < 6:
x += 1
if x % 2 == 0:
continue
print('*')
Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 7
What is scope?
Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 8
DRAG DROP Assuming that the phonc_dir dictionary contains namemumber pairs, arrange the code boxes to create a valid line of code which retrieves Martin Eden's phone number, and assigns it to the number variable. 
Drag & Drop
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 9
Why are local variable names beginning with an underscore discouraged?
Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 10
The following list is given:
tech_names = ['python', 'django', 'pandas']
How do you remove all items from the list? (select 2)
Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 11
What is the expected output of the following code?
x = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]
def func(data):
res = data[0][0]
for da in data:
for d in da:
if res < d:
res = d
return res
print(func(x[0]))
Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 12
What is the result of the following code snippet?
val1 = 10
val2 = 20
val3 = val1 > val2 or val2 % val1 == 0
print(val3)
Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 13
What will be the output of the following Python code?
d = {0, 1, 2}
for x in d:
print(x)
Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 14
You have the following code:
user_input = input("Enter a number: ")
result = user_input ** 2.0
print(f'{user_input} to the power of 2 is {result}')
User enters 10. The result of the input() function is a string. How can you modify this code to get rid of
the TypeError exception and get the result 100.0? (select 2)
Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 15
What is the expected output of the following code?
def fun():
return True
x = fun(False)
print(x)
Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 16
What is the output of the following Python code?
x = "Hello, World!"
result = x.split(",")
print(result)
Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 17
Please fill the blank field(s) in the statement with the right words. Program code making use of a given module is called a ________ of the module.
Your Answer
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 18
What is the expected output of the following code?
def func(message, num=1):
print(message * num)
func('Hello')
func('Welcome', 3)
Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 19
What is the result of the following code snippet?
def compute(i, j):
return i ** 2 + j ** 2
print(compute(j=2, 2))
Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 20
Who is the creator of Python?
Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Question 1 of 20