+ 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)

6th Oct 2020, 9:06 PM
Solus
Solus - avatar
1 Antwort
+ 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)
6th Oct 2020, 9:25 PM
💡Arno Gevorgyan 🐍
💡Arno Gevorgyan 🐍 - avatar