Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started