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 | Set: 4

Questions 31

What is the expected behavior of the following code?

PCAP-31-03 Question 31

Options:
A.

it outputs list assignment index out of range

B.

the code is erroneous and it will not execute

C.

it outputs </class 'IndexError'>

D.

it outputs error

Questions 32

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

Options:
A.

open () requires a second argument

B.

open () is a function which returns an object that represents a physical file

C.

instd, outstd, errstd are the names of pre-opened streams

D.

if invoking open () fails, an exception is raised

Questions 33

Executing the following snippet

PCAP-31-03 Question 33

will cause the dct:

Options:
A.

to hold two keys named ‘pi’ linked to 3.14 and 3.1415 respectively

B.

to hold two key named ‘pi’ linked to 3.14 and 3.1415

C.

to hold one key named ‘pi’ linked to 3.1415

D.

to hold two keys named ‘pi’ linked to 3.1415

Questions 34

What is the expected behavior of the following code?

PCAP-31-03 Question 34

Options:
A.

it outputs [1, 3]

B.

the code is erroneous and it will not execute

C.

it outputs [3, 1]

D.

it outputs [4, 2, 0]

Questions 35

What is true about Python packages? (Select two answers)

Options:
A.

the sys.path variable is a list of strings

B.

_pycache_is a folder that stores semi-completed Python modules

C.

a package contents can be stored and distributed as an mp3 file

D.

a code designed to initialize a package's state should be placed inside a file named init.py

Questions 36

Which of the following words can be used as a variable name? (Select two valid names)

Options:
A.

for

B.

True

C.

true

D.

For

Questions 37

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

Options:
A.

two

B.

zero

C.

one

D.

three

Questions 38

Which one of the platform module functions should be used to determine the underlying platform name?

Options:
A.

platform.uname ()

B.

platform.platform ()

C.

platform.python_version()

D.

platform.processor()

Questions 39

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

PCAP-31-03 Question 39

Options:
A.

'var' in Object.__dict__

B.

'prop' in Class.__dict

C.

len(Object.__diet__) == 1

D.

'var1 in Class, dict

Questions 40

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

Exam Code: PCAP-31-03
Certification Provider: Python Institute
Exam Name: Certified Associate in Python Programming
Last Update: Jul 14, 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.