I have a question about a program:
class A:
def __init__(self, x, y):
self.x = x
self.y = y
def to_string(self):
return "x, y = (" + str(self.x) + ", " + str(self.y) + ")"
def __str__(self):
return self.to_string()
class B(A):
def __init__(self, z, *args):
A.__init__(self, *args)
self.z = z
def __str__(self):
return super().__str__()
class C(A):
def __init__(self, *args):
super().__init__(*args)
def to_string(self):
return "Klasse C, " + super().to_string()
Why I have to write
A.__init__(self, *args)
instead of
A.__init__(*args)
In class C it works? Lots of greetings