Python Institute certification · Exam PCAP-31-03

PCAP-31-03 Mock Exam Page 3

Certified Associate in Python Programming

Free PCAP-31-03 mock exam questions 21–30, each with the answer and an explanation.

20 questions · 33 minutes · free, no sign-up

Free PCAP-31-03 questions

21–30 of 39 free
Question 21 Choose 2
Which of the following lambda function definitions are correct? (Select two answers)
Show answerHide answer

Correct answer: A, B lambda X : Nonelambda : 3,1415

Question 22 Choose 1
What is the expected behavior of the following code?

Show answerHide answer

Correct answer: B it outputs list assignment index out of range

Question 23 Choose 1
Executing the following snippet



will cause the dct:
Show answerHide answer

Correct answer: C to hold one key named ‘pi’ linked to 3.1415

Question 24 Choose 1
What is the expected output of the following snippet?

Show answerHide answer

Correct answer: B The code will cause a runtime exception

Question 25 Choose 1
What will be the value of the i variable when the while e loop finishes its execution?

Show answerHide answer

Correct answer: A 1

Explanation

Question 26 Choose 1
What is the expected behavior of the following code?

Show answerHide answer

Correct answer: A it outputs False

Question 27 Choose 1
Python's built-in function named open () tries to open a file and returns:
Show answerHide answer

Correct answer: C a stream object

Question 28 Choose 1
What is the expected output of the following code?

def foo(x,y,z):
return x(y) - x(z)
print{f00(lambda x: x % 2, 2, 1) )
Show answerHide answer

Correct answer: C -1

Question 29 Choose 1
What is the expected output of the following snippet?

Show answerHide answer

Correct answer: A the code is erroneous

Question 30 Choose 2
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)

Show answerHide answer

Correct answer: B, D self put stire(1])self .put (self.store[1])

Full mock exam

Sit the PCAP-31-03 exam before exam day

Full-length mocks with the same number of questions and the same time limit as the real PCAP-31-03 exam. Every attempt draws a new set of questions from the full bank, so you can keep going until you pass comfortably.

Get full PCAP-31-03 mock exam
  • 65questions per mock
  • 105 mintime limit
  • 133questions in the bank
  • Newmock on every attempt