Pcap 31 02 PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Python Institute PCAP-31-02

Certified Associate in Python Programming


Python Institute PCAP-31-02 Dumps Available Here at:
https://www.certification-questions.com/python-institute-exam/pcap-31-02-dumps.html

Enrolling now you will get access to 40 questions in a unique set of


PCAP-31-02 dumps

Question 1
Can a module run Eke regular code?

Options:

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

Answer: D

Explanation:
you write a module (a .py file) where it can be executed directly. Alternatively, it can also be
imported and used in another module. By doing the main check, you can have that code only execute
when you want to run the module as a program and not have it execute when someone just wants to
import your module and call your functions themselves.

Question 2
How many elements will the list2 list contain after execution of the following snippet?
list1 = [False for i in range (1, 10) ]
list2 = list1 [-1:1:-1]

Options:

A. zero

B. five

C. seven

D. three

https://www.certification-questions.com
Python Institute PCAP-31-02

Answer: C

Explanation:
929]
Explanation:

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

Options:

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

Answer: B, C

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

Options:

A. 1

B. 0

C. 2

https://www.certification-questions.com
Python Institute PCAP-31-02

D. the variable becomes unavailable

Answer: A

Explanation:
9327]
Explanation:

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

Options:

A. - -

B. ++

C. <<

D. >>

Answer: C, D

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

https://www.certification-questions.com
Python Institute PCAP-31-02

Options:

A. BB

B. CC

C. AA

D. BC

Answer: B, C

Question 7
What can you deduce from the following statement0 (Select two answers) str = open('file.txt',
"rt")

Options:

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

https://www.certification-questions.com
Python Institute PCAP-31-02

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

Answer: A, D

Question 8
The first parameter of each method:

Options:

A. holds a reference to the currentlv 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

Answer: D

Question 9
What is the expected output of the following snippet?

Options:

https://www.certification-questions.com
Python Institute PCAP-31-02

A. 3

B. 1

C. 2

D. the code is erroneous

Answer: A

Explanation:
39667]
Explanation:

Question 10
The simplest possible class definition in Python can be expressed as:

Options:

A. class X:

B. class X:

pass

C. class X:

return

D. class X: {}

Answer: A

Would you like to see more? Don't miss our PCAP-31-02


PDF file at:
https://www.certification-questions.com/python-institute-pdf/pcap-31-02-pdf.html

https://www.certification-questions.com

You might also like