Halloween Special Sale - 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: spcl70

PCAP-31-03 PDF

$33

$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

$52.8

$175.99

3 Months Free Update

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

PCAP-31-03 Engine

$39.6

$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

With regards to the directory structure below, select the proper forms of the directives in order to import module_c. (Select two answers)

PCAP-31-03 question answer

A.

from pypack.upper.lower import module_c

B.

import pypack.upper.lower.module_c

C.

import upper.module_c

D.

import upper.lower.module_c

Full Access
Question # 7

What is the expected output of the following code?

PCAP-31-03 question answer

A.

True

B.

0

C.

False

D.

None

Full Access
Question # 8

What is the expected output of the following code?

PCAP-31-03 question answer

A.

21

B.

2

C.

3

D.

12

Full Access
Question # 9

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 # 10

Can a module run like regular code?

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

Full Access
Question # 11

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 # 12

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

A.

for

B.

True

C.

true

D.

For

Full Access
Question # 13

What is the expected output of the following code if the file named existing_text_file is a non-zero length text file located inside the working directory?

PCAP-31-03 question answer

A.

the length of the first line from the file

B.

-1

C.

the number of lines contained inside the file

D.

the length of the last line from the file

Full Access
Question # 14

What is the expected output of the following snippet?

PCAP-31-03 question answer

A.

abc

B.

The code will cause a runtime exception

C.

ABC

D.

123

Full Access
Question # 15

What is the expected behavior of the following code?

PCAP-31-03 question answer

A.

it outputs 1

B.

it outputs 2

C.

the code is erroneous and it will not execute

D.

it outputs 3

Full Access
Question # 16

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 # 17

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 # 18

Assuming that the math module has been successfully imported, which of the following expressions evaluate to True? (Select two answers)

A.

math. hypot (3,4) == math.sqrt (25)

B.

math. hypot (2,5) == math.truec (2.5)

C.

math. hypot (2,5) == math.true (2.5)

D.

math. cell (2,5) == math.floor (2.5)

Full Access
Question # 19

What is the expected behavior of the following code?

PCAP-31-03 question answer

A.

the code is erroneus and it will not execute

B.

it outputs [2, 4]

C.

it outputs [4, 2]

D.

it outputs [0, 1, 2, 3, 4]

Full Access
Question # 20

What is the expected behavior of the following code?

PCAP-31-03 question answer

It will:

A.

print 4321

B.

print

C.

cause a runtime exception

D.

print 1234

Full Access
Question # 21

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 # 22

Which of the equations are True? (Select two answers)

A.

chr (ord (x)) = = x

B.

ord (ord (x)) = = x

C.

chr (chr (x)) = = x

D.

ord (chr (x)) = = x

Full Access
Question # 23

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

Full Access
Question # 24

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 # 25

What is true about the following snippet? (Select two answers)

PCAP-31-03 question answer

A.

the code will raise an unhandled exception

B.

the string I feel fine 'will be seen

C.

the string it's nice to see you will be seen

D.

the string what a pity will be seen

Full Access
Question # 26

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 # 27

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

A.

- -

B.

++

C.

<<

D.

>>

Full Access
Question # 28

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

PCAP-31-03 question answer

A.

is instance(obj_b,C)

B.

C._C__VarA == 2

C.

has atr (B, 'get')

D.

obj_c.get() == 2

Full Access
Question # 29

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 # 30

What is true about Python class constructors? (Choose two.)

A.

there can be more than one constructor in a Python class

B.

the constructor must return a value other than None

C.

the constructor is a method named __init__

D.

the constructor must have at least one parameter

Full Access
Question # 31

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 # 32

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 # 33

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

PCAP-31-03 question answer

A.

1

B.

0

C.

2

D.

the variable becomes unavailable

Full Access
Question # 34

What is the expected output of the following snippet?

PCAP-31-03 question answer

A.

3

B.

1

C.

2

D.

the code is erroneous

Full Access
Question # 35

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 answer

A.

put self.store(1])

B.

self put stire(1])

C.

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

D.

self .put (self.store[1])

Full Access
Question # 36

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 # 37

A file name like this one below says mat: (select three answers)

services. cpython-36.pyc

A.

the interpreter used to generate the file is version 3.6

B.

it has been produced by CPython

C.

it is the 36th version of the file

D.

the file comes from the services . py source file

Full Access
Question # 38

Which of the following snippets will execute without raising any unhandled exceptions? (Select answers)

A)

PCAP-31-03 question answer

B)

PCAP-31-03 question answer

C)

PCAP-31-03 question answer

D)

PCAP-31-03 question answer

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 39

What is the expected behavior of the following snippet?

PCAP-31-03 question answer

It will:

A.

cause a runtime exception on line 02

B.

cause a runtime exception on line 01

C.

cause a runtime exception on line 03

D.

print3

Full Access
Question # 40

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 # 41

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

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

Full Access
Question # 42

You are going to read just one character from a stream called s. Which statement would you use?

A.

ch = read(s, 1)

B.

ch = s. input(1)

C.

ch = input(s, 1)

D.

ch = s. read(l)

Full Access
Question # 43

What is the expected behavior of the following code?

PCAP-31-03 question answer

A.

it outputs 1

B.

it outputs 0

C.

it raises an exception

D.

it outputs 2

Full Access
Question # 44

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 # 45

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

Full Access
Question # 46

A Python module named pymod.py contains a variable named pyvar.

Which of the following snippets will let you access the variable? (Select two answers)

A.

import pyvar from pymod pyvar = 1

B.

from pymod import pyvar = 1

C.

from pymod import pyvar pyvar ()

D.

import pymod pymod.pyvar = 1

Full Access