Practice Free PCEP-30-02 Exam Online Questions
What is the expected output of the following code?

- A . 2
- B . 1
- C . The code is erroneous.
- D . 3
- E . 4
What is true about compilation? (Choose two.)
- A . The code is converted directly into machine code executable by the processor
- B . It tends to be faster than interpretation
- C . It tends to be slower than interpretation
- D . Both you and the end user must have the code
What is the expected output of the following code?

- A . 13
- B . 33
- C . The code is erroneous.
- D . 11
- E . 31
DRAG DROP
Drag and drop the conditional expressions to obtain a code which outputs * to the screen. (Note: some code boxes will not be used.)

Explanation:
One possible way to drag and drop the conditional expressions to obtain a code which outputs to the screen is:
if pool > 0:
print("*")
elif pool < 0:
print("")
else:
print("*")
This code uses the if, elif, and else keywords to create a conditional statement that checks the value of the variable pool. Depending on whether the value is greater than, less than, or equal to zero, the code will print a different pattern of asterisks to the screen. The print function is used to display the output. The code is indented to show the blocks of code that belong to each condition. The code will output * if the value of pool is positive, if the value of pool is negative, and if the value of pool is zero.
You can find more information about the conditional statements and the print function in Python in the following references:
[Python If … Else]
[Python Print Function]
[Python Basic Syntax]
What is the expected output of the following code?

- A . 30
- B . 29
- C . 28
- D . 31
An assertion can be used to:
- A . Stop the program when some data have improper values.
- B . Import a module.
- C . Make the Programmer more assertive.
Consider the following list.
data = [1, 5, 10, 19, 55, 30, 55, 99]
Which of the code snippets below would produce a new list like the following?
[1, 5, 10, 99]
A )

B )

C ) None of the above.
D )

E )

- A . Option A
- B . Option B
- C . Option C
- D . Option D
- E . Option E
An alternative name for a data structure called a stack is:
- A . LIFO
- B . FIFO
- C . FOLO
Which of the following for loops would output the below number pattern?

A )
![]()
B )
![]()
C )
![]()
D )
![]()
- A . Option A
- B . Option B
- C . Option C
- D . Option D
What is the expected output of the following code?

- B . The code is erroneous.
- D . *
