Pre-Summer Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code = getmirror

Pass the Python Institute PCAP PCAP-31-03 Questions and answers with ExamsMirror

Practice at least 50% of the questions to maximize your chances of passing.
Exam PCAP-31-03 Premium Access

View all detail and faqs for the PCAP-31-03 exam


833 Students Passed

93% Average Score

96% Same Questions
Viewing page 5 out of 5 pages
Viewing questions 41-50 out of questions
Questions # 41:

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

Options:

A.

sorted ("python'')

B.

"python" .sort ( )

C.

sort" ("python")

D.

"python' ,find (" ")

Questions # 42:

What is the expected behavior of the following code?

Question # 42

Options:

A.

it outputs 0

B.

it outputs 1

C.

it raises an exception

D.

it outputs 2

Questions # 43:

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

Options:

A.

the__name__variable content determines the way in which the module was run

B.

a package can be stored as a tree of sub-directories/sub-folders

C.

__pycache__is the name of a built-in variable

D.

hashbang is the name of a built-in Python function

Questions # 44:

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

The first parameter of each method:

Options:

A.

holds a reference to the currently processed object

B.

is always set to None

C.

is set to a unique random value

D.

is set by the first argument's value

Questions # 46:

What can you deduce from the following statement? (Select two answers)

str = open('file.txt', "rt")

Options:

A.

str is a string read in from the file named file.txt

B.

a newlina character translation will be performed during the reads

C.

if file. txt does not exist, it will be created

D.

the opened file cannot be written with the use of the str variable

Questions # 47:

What is the expected behavior of the following code?

Question # 47

Options:

A.

It outputs 3.

B.

It outputs 1.

C.

It outputs 6.

D.

It raises an exception

Questions # 48:

If you want to access an exception object's components and store them in an object called e, you have to use the following form of exception statement

Options:

A.

except Exception(e):

B.

except e=Exception:

C.

except Exception as e:

D.

such an action is not possible in Python

Questions # 49:

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

Options:

A.

two

B.

zero

C.

one

D.

three

Questions # 50:

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

Options:

A.

except Ex1 Ex2:

B.

except (ex1, Ex2):

C.

except Ex1, Ex2:

D.

except Ex1+Ex2:

Viewing page 5 out of 5 pages
Viewing questions 41-50 out of questions
TOP CODES

TOP CODES

Top selling exam codes in the certification world, popular, in demand and updated to help you pass on the first try.