Summer Special - 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: c4sdisc65

PCAP-31-03 PDF

$38.5

$109.99

3 Months Free Update

  • Printable Format
  • Value of Money
  • 100% Pass Assurance
  • Verified Answers
  • Researched by Industry Experts
  • Based on Real Exams Scenarios
  • 100% Real Questions

PCAP-31-03 PDF + Testing Engine

$61.6

$175.99

3 Months Free Update

  • Exam Name: Certified Associate in Python Programming
  • Last Update: Sep 12, 2025
  • Questions and Answers: 147
  • Free Real Questions Demo
  • Recommended by Industry Experts
  • Best Economical Package
  • Immediate Access

PCAP-31-03 Engine

$46.2

$131.99

3 Months Free Update

  • Best Testing Engine
  • One Click installation
  • Recommended by Teachers
  • Easy to use
  • 3 Modes of Learning
  • State of Art Technology
  • 100% Real Questions included

PCAP-31-03 Practice Exam Questions with Answers Certified Associate in Python Programming Certification

Question # 6

A variable stored separately in every object is called:

A.

there are no such variables, all variables are shared among objects

B.

a class variable

C.

an object variable

D.

an instance variable

Full Access
Question # 7

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

A.

closing an open file is performed by the closefile ( ) function

B.

the second open ( ) argument describes the open mode and defaults to ‘w’

C.

if open ( ) ‘s second argument is ‘r’ the file must exist or open will fail

D.

if open ( )’s second argument is ‘w’ and the invocation succeeds, the previous file’s content is lost

Full Access
Question # 8

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

A.

a code point is a point inside the code when execution stops immediately

B.

an escape sequence can be recognized by the # sign put in front of it.

C.

UTF-8 is one of the ways of representing UNICODE code points.

D.

ASCII is the name of a character coding standard

Full Access
Question # 9

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

string = 'SKY' (:: -1)

string = string (-1)

A.

string is None

B.

string (0) == string (-1

C.

string (0) == 'Y'

D.

len (string) == 1

Full Access
Question # 10

A Python module named pymod, py contains a function named pyfun ( ).

Which of the following snippets will let you invoke the function? (Select two answers)

A.

From pymod import ‘

Pymod.pyfun ( )

B.

Import pymod

Pymod. Pyfun ( )

C.

Import pyfun from pymod

Pyfun ( )

D.

From pymod import pyfun

Pyfun ( )

Full Access
Question # 11

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

A.

str(1-1) in '012345£739'[:2]

B.

'phd' in 'alpha'

C.

'deb' not in 'abcde' [::-1]

D.

'True' not in 'False'

Full Access
Question # 12

If you want to transform a string into a list of words, what invocation would you use? (Select two answers)

Expected output:

PCAP-31-03 question answer

A.

s.split ()

B.

split (s, "˜ "˜)

C.

s.split ("˜ "˜)

D.

split (s)

Full Access
Question # 13

A compiler is a program designed to (select two answers)

A.

rearrange the source code to make it clearer

B.

check the source code in order to see if its correct

C.

execute the source code

D.

translate the source code into machine code

Full Access
Question # 14

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

A.

the constructor must have at least one parameter

B.

the constructor must return a value other than None

C.

the constructor is a method named_init_

D.

there can the more than one constructor in a Python class.

Full Access
Question # 15

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")

A.

'key' in diet

B.

diet['key'] != None

C.

diet.exists('key')

D.

'key' in diet.keys()

Full Access
Question # 16

What is the output of the following piece of code?

PCAP-31-03 question answer

A.

ant'bat'camel

B.

ant"bat"camel

C.

antbatcamel

D.

ant bat camel

Full Access
Question # 17

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) )

A.

1

B.

0

C.

-1

D.

an exception is raised

Full Access
Question # 18

What is the expected behavior of the following code?

PCAP-31-03 question answer

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

Full Access
Question # 19

Assuming that String is six or more letters long, the following slice

String[1:-2]

is shorter than the original string by:

A.

four chars

B.

three chars

C.

one char

D.

two chars

Full Access
Question # 20

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

A.

.3423e2

B.

3423e-2

C.

.3423e-2

D.

3423e2

Full Access
Question # 21

What is the expected behavior of the following code?

PCAP-31-03 question answer

A.

it outputs list assignment index out of range

B.

the code is erroneous and it will not execute

C.

it outputs

D.

it outputs error

Full Access
Question # 22

Is it possible to safely check if a class object has a certain attribute0

A.

yes, by using the hasattr attribute

B.

yes. by using the hasattr () method

C.

yes, by using the hasattr () function

D.

no, it is not possible

Full Access
Question # 23

The following class hierarchy is given. What is the expected output of the code?

PCAP-31-03 question answer

A.

BB

B.

CC

C.

AA

D.

BC

Full Access
Question # 24

Python's built-in function named open () tries to open a file and returns:

A.

an integer value identifying an opened file

B.

an error code (0 means success)

C.

a stream object

D.

always None

Full Access
Question # 25

The following expression

1+-2

is:

A.

equal to 1

B.

invalid

C.

equal to 2

D.

equal to -1

Full Access
Question # 26

What is the expected behavior of the following code?

PCAP-31-03 question answer

It will:

A.

print 0

B.

cause a runtime exception

C.

prints 3

D.

print an empty line

Full Access
Question # 27

You need data which can act as a simple telephone directory. You can obtain it with the following clauses (choose two relevant variants; assume that no other items have been created before)

A.

dir={'Mom':5551234567, 'Dad':5557654321>

B.

dir={'Mom':'5551234567', * Dad':'5557654321'}

C.

dir={Mom:5551234567, Dad:5557654321}

D.

dir={Mom:'5551234567', Dad:'5557654321'}

Full Access
Question # 28

What is the expected behavior of the following code?

x = 8 ** (1/3)

y = 2. if x < 2.3 else 3.

print(y)

A.

it outputs 2.0

B.

it outputs 2. 5

C.

the code is erroneus and it will not execute

D.

it outputs 3.0

Full Access
Question # 29

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

A.

- -

B.

++

C.

<<

D.

>>

Full Access
Question # 30

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

A.

Python strings are actually lists

B.

Python strings can be concatenated

C.

Python strings can be sliced like lists

D.

Python strings are mutable

Full Access
Question # 31

Files with the suffix .pyc contain:

A.

Python 4 source code

B.

backups

C.

temporary data

D.

semi-compiled Python code

Full Access
Question # 32

What is the expected output of the following code?

PCAP-31-03 question answer

A.

3

B.

5

C.

4

D.

an exception is raised

Full Access
Question # 33

There is a stream named s open for writing. What option will you select to write a line to the stream''

A.

s.write("Hello\n")

B.

write(s, "Hello")

C.

s.writeln("Hello")

D.

s.writeline("Hello")

Full Access
Question # 34

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

PCAP-31-03 question answer

A.

a is not None

B.

a ! =b

C.

b () ==4

D.

a () == 4

Full Access
Question # 35

What is the expected behavior of the following code?

PCAP-31-03 question answer

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]

Full Access
Question # 36

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

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

Full Access
Question # 37

A property that stores information about a given class's super-classes is named:

A.

_upper_

B.

_bases_

C.

_ancestors_

D.

_super_

Full Access
Question # 38

Assuming that the following snippet has been successfully executed, which of the equations are False? (Select two answers)

PCAP-31-03 question answer

A.

len(a)== len (b)

B.

a [0]-1 ==b [0]

C.

a[0] = b[0]

D.

b[0] - 1 == a[0]

Full Access
Question # 39

Python strings can be “glued” together using the operator:

A.

.

B.

&

C.

_

D.

+

Full Access
Question # 40

What is the expected behavior of the following code?

PCAP-31-03 question answer

A.

it outputs 2

B.

the code is erroneous and it will not execute

C.

it outputs 3

D.

it outputs :

Full Access
Question # 41

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()

Full Access
Question # 42

If you need to serve two different exceptions called Ex1 and Ex2 in one except branch, you can write:

A.

except Ex1 Ex2:

B.

except (ex1, Ex2):

C.

except Ex1, Ex2:

D.

except Ex1+Ex2:

Full Access
Question # 43

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

A.

len('\'•) == 1

B.

len("""

""") == o

C.

chr(ordCA') + 1) == 'B'

D.

ord("Z") - ord("z") -- ord("0")

Full Access
Question # 44

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

A.

121 + 1 != '!' + 2 * '2'

B.

'AbC' lower () < 'AB'

C.

'1' + '1' + '1' < '1' * 3'

D.

'3.14' != str(3.1415)

Full Access