+ 16
PYTHON CHALLENGE QUESTION [SOLVED]
class A: def __init__ (self, value): self.a = 1 class B(A): def __init__ (self, value = 2): super.__init__(value) ab = B(8) print(ab.a) This particular python challenge question has an answer of 1 (ie value of a in class A) in the quiz, but on pydroid, it throws this error: TypeError: descriptor '__init__' requires a super object but received a 'int'. What could be the issue here?... 🤔
4 Antworten
+ 12
You missed the parentheses in your call to super()
super().__init__(value)
+ 5
ChaoticDawg
Oh ok...
🤦🏽♂️
Thanks men 👍🏼
- 1
B
- 1
a