+ 1
Python - How can we fix TypeError: __init__() missing 1 required positional argument: 'value' ?
class A: def __init__(self, value): self.value = value class B(A): def __init__(self, value2): super().__init__() zzz = B(123) print(zzz.value)
1 Réponse
+ 3
class A:
def __init__(self, value):
self.value = value
class B(A):
def __init__(self, value):
super().__init__(value)
zzz = B(123)
print(zzz.value)