Hello, I'm doing inheritance in python and am encountering the following error:
TypeError:
__init__()
takes exactly 2 positional arguments (4 given)
class A():
def __init__(self,a,b):
self.a = a
self.b = b
class B(A):
def __init__(self,c):
self.c = c
super().__init__(self)
if __name__ == '__main__':
a =10
b = 5
c = 8
teste = B(a,b,c)
In class B
I would like to use the constructor of class A
and add another parameter in the constructor of class B
.