In the following code, what is init_()?

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter10: Classes And Objects
Section: Chapter Questions
Problem 5RQ: Which of the following statements is false? a. A class can contain only one constructor. b. An...
icon
Related questions
Question
QUESTION 9
When one object invokes a method of another object, the first object is said to send the second object a(n)
QUESTION 11
In the following code, what is
init_()?
class Critter(object):
"""A virtual pet"""
init (self, n):
self.name =
%3D
O a docstring
O a class name
Oa method
O an attribute
QUESTION 15
What will the value of the variable data be after the following code executes (Aume that file.txt is a valid text file that can be read by the code
f - open ("file.txt", "z")
data - f.readlines ()
f.close ()
O The first character of the text file
O The first line of the text file
The entire text file as a string
O The entire texI file as a list of strings
QUESTION 22
Whenever you're done with a file, it's good programming practice to
it.
QUESTION 23
How can pickled objects written to a file, using cPickle.dump() function, be accessed?
O sequentially
O randomly
O they cannot be accessed
O None of these
QUESTION 26
What will be displayed by the following code?
class A(object):
def ml(self):
print ("A - ml", end=" ")
def m2 (self):
print ("A
m2" , end=" ")
class B(A) :
def m2(self):
super (B, self).m2()
print("B - m2"
end=" ")
def m3 (self):
print ("B
m3", end=" ")
O = B()
%3D
o.m2 ()
O A - m2
OB
m2
O A -
m2 B - m2
OB
m2 A - m2
Transcribed Image Text:QUESTION 9 When one object invokes a method of another object, the first object is said to send the second object a(n) QUESTION 11 In the following code, what is init_()? class Critter(object): """A virtual pet""" init (self, n): self.name = %3D O a docstring O a class name Oa method O an attribute QUESTION 15 What will the value of the variable data be after the following code executes (Aume that file.txt is a valid text file that can be read by the code f - open ("file.txt", "z") data - f.readlines () f.close () O The first character of the text file O The first line of the text file The entire text file as a string O The entire texI file as a list of strings QUESTION 22 Whenever you're done with a file, it's good programming practice to it. QUESTION 23 How can pickled objects written to a file, using cPickle.dump() function, be accessed? O sequentially O randomly O they cannot be accessed O None of these QUESTION 26 What will be displayed by the following code? class A(object): def ml(self): print ("A - ml", end=" ") def m2 (self): print ("A m2" , end=" ") class B(A) : def m2(self): super (B, self).m2() print("B - m2" end=" ") def m3 (self): print ("B m3", end=" ") O = B() %3D o.m2 () O A - m2 OB m2 O A - m2 B - m2 OB m2 A - m2
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Lock objects
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage