What will be the correct output of the following Python code?
class X(object):
def __init__(self,a):
self.num = a
def dbup(self):
self.num *= 2
class Y(X):
def __init__(self,a):
X.__init__(self, a)
def tpup(self):
self.num*= 3
obj = Y(4)
print(obj.num*2/1)
obj.dbup()
print(obj.num*3/2)
obj.tpup()
print(obj.num/2*3)
Correct Answer:
8.0
12.0
36.0
Explanation:
Note: This Question is unanswered, help us to find answer for this one
More Python MCQ Questions