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

Free Python Institute PCAP-31-03 Practice Exam with Questions & Answers

Questions 1

Is it possible to safely check if a class/object has a certain attribute?

Options:
A.

yes, by using the hasattr attribute

B.

yes, by using the hasattr ( ) method

C.

yes, by using the hassattr ( ) function

D.

no, it is not possible

Python Institute PCAP-31-03 Premium Access
Questions 2

What is the expected behavior of the following code?

PCAP-31-03 Question 2

Options:
A.

It outputs False

B.

It outputs nothing

C.

It outputs True

D.

It raises an exception

Questions 3

Assuming that the following piece of code has been executed successfully, which of the expressions evaluate to True? (Choose two.)

PCAP-31-03 Question 3

Options:
A.

isinstance (obj_b,A)

B.

A.VarA == 1

C.

obj_a is obj_aa

D.

B.VarA == 1

Questions 4

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

PCAP-31-03 Question 4

Options:
A.

a ( ) == 4

B.

a is not None

C.

b ( ) == 4

D.

a ! = b

Questions 5

What is the expected output of the following code if existing_file is the name of a file located inside the working directory?

PCAP-31-03 Question 5

Options:
A.

1 2

B.

1 2 3

C.

1 3

D.

2 3

Questions 6

How many elements will the list2 list contain after execution of the following snippet?

list1 = [False for i in range (1, 10) ]

list2 = list1 [-1:1:-1]

Options:
A.

zero

B.

five

C.

seven

D.

three

Questions 7

The following expression

1+-2

is:

Options:
A.

equal to 1

B.

invalid

C.

equal to 2

D.

equal to -1

Questions 8

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

Options:
A.

len ('' ' '') == 2

B.

len ( ' ' ' 12

34 ' ' ') == 4

C.

chr (ord('z') - 1 == 'Y'

D.

ord (''0'') - ord (''9'') == 10

Questions 9

Can a module run like regular code?

Options:
A.

yes, and it can differentiate its behavior between the regular launch and import

B.

it depends on the Python version

C.

yes, but it cannot differentiate its behavior between the regular launch and import

D.

no. it is not possible; a module can be imported, not run

Questions 10

Which of the following sentences are true? (Select two answers)

Options:
A.

lists may not be stored inside tuples

B.

tuples may be stored inside lists

C.

tuples may not be stored inside tuples

D.

lists may be stored inside lists

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

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.