Win IT Exam with Last Dumps 2024


Python PCAP Exam

Page 14/15
Viewing Questions 131 140 out of 146 Questions
93.33%

Question 131
With regards to the directory structure below, select the proper forms of the directives in order to import module_b. (Choose two.)
Image PCAP_131Q.png related to the Python PCAP Exam
A. from pyback.upper import module_b
B. import pyback.upper.module_b
C. import upper.module_b
D. import module_b

Question 132
Which of the following lines of code will work flawlessly when out independently inside the inc() method in order to make the snippet's output equal to 3?(Choose two.)
Image PCAP_132Q.png related to the Python PCAP Exam
A. put(self.prop+val)
B. self.put(get()+val)
C. self.put(self.get()+val)
D. self.put(self.prop+val)

Question 133
What is the expected output of the following code?
Image PCAP_133Q.png related to the Python PCAP Exam
A. False
B. 0
C. None
D. True

Question 134
What is true about Python class constructors? (Choose two.)
A. there can be only one constructor in a Python class
B. the constructor cannot be invoked directly under any circumstances
C. the constructor cannot return a result other than None
D. the constructor's first parameter must always be named self

Question 135
What is the expected behavior of the following code?
Image PCAP_135Q.png related to the Python PCAP Exam
A. 4
B. 3
C. an exception is raised
D. 5


Question 136
Assuming that the following inheritance set is in force, which of the following classes are declared properly? (Choose two.)
Image PCAP_136Q.png related to the Python PCAP Exam
A. class Class_3(A,C): pass
B. class Class_4(C,B): pass
C. class Class_1(D): pass
D. class Class_2(A,B): pass

Question 137
What is the expected behavior of the following code?
Image PCAP_137Q.png related to the Python PCAP Exam
A. it outputs 0
B. the code is erroneous and it will not execute
C. it outputs 1
D. it outputs 2

Question 138
Which of the following expressions evaluate to True? (Choose two.)
A. 'in' in 'Thames'
B. 'in' in 'in'
C. 'in not' in 'not'
D. 't'.upper() in 'Thames'

Question 139
What is the expected behavior of the following code?
Image PCAP_139Q.png related to the Python PCAP Exam
A. it outputs 2
B. it raises an exception
C. it outputs 1
D. it outputs 0

Question 140
Which of the following invocations are valid? (Choose two.)
A. sort("python")
B. "python".find("")
C. "python".rindex("th")
D. 'python'.sorted()