Big Halloween 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: 5

Questions 41

What is the expected behavior of the following code?

PCAP-31-03 Question 41

Options:
A.

it outputs 6

B.

it outputs 1

C.

it outputs 3

D.

it raises an exception

Questions 42

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 43

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)

Options:
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

Questions 44

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)

PCAP-31-03 Question 44

Options:
A.

str(Object) == 'Object'

B.

_name == _main_'

C.

ClassA. _module_ == 'ClassA'

D.

len(ClassB.__bases__) == 1

Questions 45

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

String[1:-2]

is shorter than the original string by:

Options:
A.

four chars

B.

three chars

C.

one char

D.

two chars

Questions 46

What is the expected behavior of the following snippet?

PCAP-31-03 Question 46

It will:

Options:
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

Exam Code: PCAP-31-03
Certification Provider: Python Institute
Exam Name: Certified Associate in Python Programming
Last Update: Oct 30, 2025
Questions: 154

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.