Free PCAP-31-03 Practice Test Questions and Answers (2026) | Cert Empire Practice Questions
Free preview: 20 questions.
Python Institute PCAP 31 03
Q: 1
What is the expected behavior of the following code?
x = 8 ** (1/3)
y = 2. if x < 2.3 else 3.
print(y)
Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 2
Which of the following statement are true? (Select two answers)
Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 3
Which of the following expressions evaluate to True? (Select two answers)
Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 4
Which of the following lambda function definitions are correct? (Select two answers)
Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 5
What is a true about python class constructors? (Select two answers)
Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 6
Assuming that the code below has been executed successfully, which of the following expressions
will always evaluate to True? (Select two answers)
import random
v1 = random. random()
v2 = random. random()
Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 7
Assuming that String is six or more letters long, the following slice
String[1:-2]
is shorter than the original string by:
Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 8
What is the output of the following piece of code?


Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 9
What is the expected behavior of the following code?


Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 10
Assuming that the following code has been executed successfully, selected the expression which
evaluate to True (Select two answers)


Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 11
Which of the following lines of code will work flawlessly when put independently inside the
add_new () method in order to make the snippet's output equal to [0, 1, 1] ? (Select two answers)


Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 12
Assuming that the following snippet has been successfully executed, which of the equations are
True? (Select two answers)


Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 13
What is the expected output of the following snippet?


Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 14
What will be the value of the i variable when the while e loop finishes its execution?


Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 15
The following class definition is given. We want the show () method to invoke the get () method, and
then output the value the get () method returns. Which of the invocations should be used instead of
XXX?


Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 16
What is the expected output of the following code?


Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 17
What is the expected behavior of the following snippet?
It will:
It will:Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 18
There is a stream named s open for writing. What option will you select to write a line to the stream''
Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 19
What can you do if you don't like a long package path tike this one0 import
alpha.beta.gamma.delta.epsiIon.zeta
Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Q: 20
What is the expected behavior of the following code?


Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Question 1 of 20