Question: Please answer all 4 questions asap. Thanks Question 8 1 pts With regard to objects, which of the following is False? An object method can

 Please answer all 4 questions asap. Thanks Question 8 1 pts

With regard to objects, which of the following is False? An objectmethod can be public, protected, or private. The __init__() method is public.An object attribute can be public, protected, or private. class Pet(object): defPlease answer all 4 questions asap. Thanks

Question 8 1 pts With regard to objects, which of the following is False? An object method can be public, protected, or private. The __init__() method is public. An object attribute can be public, protected, or private. class Pet(object): def _init_(self, name, species): self._name = name self._species = species def command(self, order): print("Hey,", self._name, '!', order) Assume that godzilla is a variable that already refe godzilla.command("Stop eating my homework!") command(self, "Stop eating my homework!") Pet.command("Stop eating my homework!") godzilla.command(self, "Stop eating my homework!") command(godzilla, "Stop eating my homework!") All data structures are data types, but not all data types are data structures. True False Question 9 1 pts Consider the following class definition: class Pet(object): def _init_(self, name, species): self._name = name self._species = species def command(self, order): print("Hey,", self._name, '!', order) Which of the following correctly creates a Pet object? mothra=Pet(self,name,species) mothra=Pet(self,name,species) mothra=Pet(Mothra,moth) mothra = Pet._init__(self, 'Mothra', 'moth') mothra=Pet(object)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!