Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis+ 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 Respostas
+ 12
You missed the parentheses in your call to super()
super().__init__(value)
+ 5
ChaoticDawg
Oh ok...
š¤¦š½āāļø
Thanks men šš¼
- 1
B
- 1
a