Winter Sale Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: s2p65

Easiest Solution 2 Pass Your Certification Exams

PCAP-31-03 Python Institute Certified Associate in Python Programming Free Practice Exam Questions (2025 Updated)

Prepare effectively for your Python Institute PCAP-31-03 Certified Associate in Python Programming certification with our extensive collection of free, high-quality practice questions. Each question is designed to mirror the actual exam format and objectives, complete with comprehensive answers and detailed explanations. Our materials are regularly updated for 2025, ensuring you have the most current resources to build confidence and succeed on your first attempt.

Page: 2 / 3
Total 154 questions

Files with the suffix .pyc contain:

A.

Python 4 source code

B.

backups

C.

temporary data

D.

semi-compiled Python code

What is the expected behavior of the following code?

A.

it outputs -2

B.

it outputs 2. 0

C.

it outputs 0. 0

D.

the code is erroneous and it will not execute

What is true about the __based__attribute in Python?

A.

It is accessible inside a class and an object.

B.

There is no such property.

C.

it is accessible inside an object

D.

It is accessible inside a class

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

A.

if a real-life object can be described with a set of adjectives, they may reflect a Python object method

B.

the same class can be used many times to build a number of objects

C.

each object of the same class can have a different set of methods

D.

a subclass is usually more specialized than its superclass

What is true about Python class constructors? (Select two answers)

A.

the constructor's first parameter identifies an object currently being created

B.

the constructor cannot use the default values of the parameters

C.

the constructor can be invoked directly under strictly defined circumstances

D.

super-class constructor is invoked implicitly during constructor execution

What is the expected behavior of the following code?

A.

it outputs 'None'

B.

it outputs 3

C.

it raises an exception

D.

it outputs 0

What is the expected behavior of the following code?

It will:

A.

print 0

B.

cause a runtime exception

C.

prints 3

D.

print an empty line

Assuming that the following inheritance set is in force, which of the following classes are declared properly? (Select two answers)

A.

class Class_4 (D, A) : pass

B.

class Class_1(C,D): pass

C.

class Class_3(A,C): pass

D.

class Class_2(B,D): pass

What will the value of the i variable be when the following loop finishes its execution?

A.

10

B.

the variable becomes unavailable

C.

11

D.

9

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

A.

'in not' in 'not'

B.

'in' in 'Thames'

C.

't' . upper ( ) in 'Thames'

D.

'in' in 'in'

What is the expected output of the following snippet?

A.

abc

B.

The code will cause a runtime exception

C.

ABC

D.

123

What is the expected out of the following code of the file named zero_length_existing_file is a zero-length file located inside the working directory?

A.

0

B.

-1

C.

an errno value corresponding to file not found

D.

2

What is the expected behavior of the following code?

A.

It outputs False

B.

It outputs nothing

C.

It outputs True

D.

It raises an exception

Which of the following invocations are valid? (Select two answers)

A.

sorted ("python'')

B.

"python" .sort ( )

C.

sort" ("python")

D.

"python' ,find (" ")

What is the expected output of the following code if there is no file named non existing_file inside the working directory?

A.

2 2

B.

1 3

C.

1 2 3

D.

2 2 3

Which of the following lambda function definitions are correct? (Select two answers)

A.

lambda X : None

B.

lambda : 3,1415

C.

lambda x : def fun(x): return x

D.

lambda lambda: lambda * lambda

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

A)

B)

C)

D)

A.

Option A

B.

Option B

C.

Option C

D.

Option D

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

A.

the__name__variable always contains the name of a package

B.

a package is a group of related modules

C.

the pyc extension is used to mark semi-compiled Python packages

D.

a package is a single file whose name ends with the pa extension

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

A.

platform.uname ()

B.

platform.platform ()

C.

platform.python_version()

D.

platform.processor()

Assuming that the code below has been placed inside a file named code.py and executed successfully which of the following expressions evaluate to True? (Select two answers)

A.

str (Object) = 'Object1

B.

Class A.__module__ == ' main__'

C.

len (ClassB.__bases__) == 2

D.

__name__== '__main__'

Page: 2 / 3
Total 154 questions
Copyright © 2014-2025 Solution2Pass. All Rights Reserved