Big Halloween Sale 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: sale65best

Free Python Institute PCAP-31-03 Practice Exam with Questions & Answers | Set: 3

Questions 21

What would you use instead of XXX if you want to check whether a certain ‘ key' exists in a dictionary called diet? (Select two answers)

II

if XXX:

print("Key exists")

Options:
A.

'key' in diet

B.

diet['key'] != None

C.

diet.exists('key')

D.

'key' in diet.keys()

Questions 22

An operator able to perform bitwise shifts is coded as (select two answers)

Options:
A.

- -

B.

++

C.

<<

D.

>>

Questions 23

What is the expected behavior of the following code?

PCAP-31-03 Question 23

Options:
A.

it outputs error

B.

it outputs list assignment index out of range

C.

the code is erroneous and it will not execute

D.

it outputs

Questions 24

What is true about Object-Oriented Programming in Python? (Select two answers)

Options:
A.

encapsulation allows you to protect some data from uncontrolled access

B.

the arrows on a class diagram are always directed from a superclass towards its subclass

C.

inheritance is the relation between a superclass and a subclass

D.

an object is a recipe for a class

Questions 25

Which of the following expressions evaluate to True? (Select two answers)

Options:
A.

121 +1 == int ('1' + 2 * '2')

B.

float ('3.14') == str('3.'+'14')

C.

'xyz'.lower() 'XY'

D.

'8' + '8' !=2 * '8'

Questions 26

Assuming that the following code has been executed successfully, select the expressions which evaluate to True (Select two answers.)

PCAP-31-03 Question 26

Options:
A.

a is not None

B.

a ! =b

C.

b () ==4

D.

a () == 4

Questions 27

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)

PCAP-31-03 Question 27

Options:
A.

put self.store(1])

B.

self put stire(1])

C.

self .put self.get () [-1])

D.

self .put (self.store[1])

Questions 28

Which of the following literals reflect the value given as 34.23? (select two answers)

Options:
A.

.3423e2

B.

3423e-2

C.

.3423e-2

D.

3423e2

Questions 29

Assuming that the following code has been executed successfully, selected the expression which evaluate to True (Select two answers)

PCAP-31-03 Question 29

Options:
A.

a ( ) == 4

B.

a is not None

C.

b ( ) == 4

D.

a ! = b

Questions 30

Which of the following expressions evaluate to True? (Select two answers)

Options:
A.

' t '.upper () in 'Thames'

B.

'in not' in 'not'

C.

'not' not in 'in'

D.

'a' not in 'ABC' .lower ()

Exam Code: PCAP-31-03
Certification Provider: Python Institute
Exam Name: Certified Associate in Python Programming
Last Update: Oct 31, 2025
Questions: 154

Python Institute Free Exams

Python Institute Free Exams
Examstrack offers free Python Institute exam materials and practice tests to aid your Python Institute certification journey.