Win IT Exam with Last Dumps 2024


Python PCAP Exam

Page 11/15
Viewing Questions 101 110 out of 146 Questions
73.33%

Question 101
What is true about Object-Oriented Programming in Python? (Choose two.)
A. each object of the same class can have a different set of methods
B. a subclass is usually more specialized than its superclass
C. if a real-life object can be described with a set of adjectives, they may reflect a Python object method
D. the same class can be used many times to build a number of objects

Question 102
What is true about Python class constructors? (Choose two.)
A. there can be more than one constructor in a Python class
B. the constructor must return a value other than None
C. the constructor is a method named __init__
D. the constructor must have at least one parameter

Question 103
Assuming that the following piece of code has been executed successfully, which of the expressions evaluate to True? (Choose two.)
Image PCAP_103Q.png related to the Python PCAP Exam
A. isinstance (obj_b,A)
B. A.VarA == 1
C. obj_a is obj_aa
D. B.VarA == 1

Question 104
Assuming that the code below has been executed successfully, which of the expressions evaluate to True? (Choose two.)
Image PCAP_104Q.png related to the Python PCAP Exam
A. len(Class.__dict__) == 1
B. 'data' in Class.__dict__
C. 'var' in Class.__dict__
D. 'data' in Object.__dict__

Question 105
A property that stores information about a given class's super-classes is named:
A. __upper__
B. __super__
C. __ancestors__
D. __bases__


Question 106
Which of the following lines of code will work flawlessly when put independently inside the add_new() method in order to make the snippet's output equal to [0,1, 2]? (Choose two.)
Image PCAP_106Q.png related to the Python PCAP Exam
A. self.queue.append(self.get_last() + 1)
B. self.queue.append(get_last() + 1)
C. self.queue.append(self.queue[-1] + 1)
D. queue.append(self.get_last() + 1)

Question 107
What is the expected output of the following code?
Image PCAP_107Q.png related to the Python PCAP Exam
A. a
B. c
C. an exception is raised
D. b

Question 108
What is the expected output of the following code if there is no file named non_existing_file inside the working directory?
Image PCAP_108Q.png related to the Python PCAP Exam
A. 1 2 4
B. 1 2 3 4
C. 2 4
D. 1 3

Question 109
What is the expected output of the following code if the file named existing_text_file is a non-zero length text file located inside the working directory?
Image PCAP_109Q.png related to the Python PCAP Exam
A. the length of the first line from the file
B. -1
C. the number of lines contained inside the file
D. the length of the last line from the file

Question 110
What is the expected behavior of the following code?
Image PCAP_110Q.png related to the Python PCAP Exam
A. it outputs [1, 3]
B. the code is erroneous and it will not execute
C. it outputs [3, 1]
D. it outputs [4, 2, 0]