+ 1
Can anyone help with this???
class Ve: def __init__(self,arr): self.arr=arr def func(self): return sum(self.arr) class N(Ve): def __init__(self,arr,q): super.__init__(arr) self.q=q def fun(self): if self.q in self.arr: return "hello" else: return "hello world" i = N([1,2,3,4],4) print(i.func()) print(i.fun())
2 Answers
+ 2
super.__init__(arr)
to
super(N, self).__init__(arr)
+ 1
more concept, just search it:
super and MRO(Method Resolution Order)