PYTHON CHALLENGE QUESTION [SOLVED] | SoloLearn: Learn to code for FREE!

+15

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?... 🤔

8/5/2020 3:42:56 PM

👑 Tchybooxuur!

4 Answers

New Answer

+12

You missed the parentheses in your call to super() super().__init__(value)

+5

ChaoticDawg Oh ok... 🤦🏽‍♂️ Thanks men 👍🏼

-1

-1