Question: Consider the following class specifications: class ClassA: def _ _ init _ _ ( self ) : self.x = 3 def mOne ( self ,

Consider the following class specifications:
class ClassA:
def __init__(self):
self.x =3
def mOne(self, i):
print(i - self.x)
def mTwo(self, i):
print(i + self.x)
def mThree(self, i):
print(i * self.x)
def mFour(self, i):
print(i % self.x)
class ClassB(ClassA):
def __init__(self):
ClassA.__init__(self)
self.y =6
def mOne(self, i):
print(self.y - i)
def mTwo(self, i):
print(self.y + i)
def mFive(self, i):
print(self.y * i)
def mSix(self, i):
print(self.y % i)
Specify the output (a numerical value) OR mark as na (to indicate not allowed) in the space provided corresponding to each the statements below:
Code Your Answers
a = ClassA()
b = ClassB()
print(a.x)
3
print(a.y)
na
print(b.x)
3
print(b.y)
6
a.mOne(3)
0
a.mTwo(3)
6
a.mThree(3)
9
a.mFour(3)
0
a.mFive(3)
na
a.mSix(3)
na
b.mOne(3)
3
b.mTwo(3)
9
b.mThree(3)
9
b.mFour(3)
0
b.mFive(3)
18
b.mSix(3)

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!