I am using python 3.4. Below is the exception I am getting-
Traceback (most recent call last):
File "./oop.py", line 20, in <module>
y = DerivedClass("Manu")
File "./oop.py", line 15, in __init__
super().__init__(self,value)
TypeError: __init__() takes 2 positional arguments but 3 were given
class Test:
class_var = 100 # class attribute
x = "Anu" # class attributes
def __init__(self,value):
self.value = value
def normal_function(self):
return self.value
class DerivedClass(Test):
def __init__(self,value):
super().__init__(self,value) #inheriting base class constructor
print(self.value*2)
if __name__ == "__main__":
test_obj = Test("Priya")