Is it possible to safely check if a class/object has a certain attribute?
A. yes, by using the hasattr attribute
B. yes, by using the hasattr ( ) method
C. yes, by using the hassattr ( ) function
D. no, it is not possible
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
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
Assuming that the following inheritance set is in force, which of the following classes are declared properly? (Select two answers)
A. class Class_4 (D, A) : pass
B. class Class_1(C,D): pass
C. class Class_3(A,C): pass
D. class Class_2(B,D): pass
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'}
What is the expected behavior of the following code?
A. it outputs 0
B. it outputs 1
C. it raises an exception
D. it outputs 2
If you want to transform a string into a list of words, what invocation would you use? (Select two answers)
Expected output:
A. s.split ()
B. split (s, "~ "~)
C. s.split ("~ "~)
D. split (s)
What is the expected behavior of the following code?
A. it outputs 6
B. it outputs 1
C. it outputs 3
D. it raises an exception
Which line can be used instead of the comment to cause the snippet to produce the following expected output? (Select two answers)
Expected output:
1 2 3
Code:
A. c, b, a = b, a, c
B. c, b, a = a, c, b
C. a, b, c = c, a, b
D. a, b, c = a, b, c
What is true about Object-Oriented Programming in Python? (Select two answers)
A. if a real-life object can be described with a set of adjectives, they may reflect a Python object method
B. the same class can be used many times to build a number of objects
C. each object of the same class can have a different set of methods
D. a subclass is usually more specialized than its superclass
Nowadays, the certification exams become more and more important and required by more and more enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare for the exam in a short time with less efforts? How to get a ideal result and how to find the most reliable resources? Here on Vcedump.com, you will find all the answers. Vcedump.com provide not only Python Institute exam questions, answers and explanations but also complete assistance on your exam preparation and certification application. If you are confused on your PCAP-31-03 exam preparations and Python Institute certification application, do not hesitate to visit our Vcedump.com to find your solutions here.