- 1

I need some urgent help in Python

I need to know how to define a new parameter in a class that inherits another class. especially a list parameter. i created the init method and put it in this way:- def __init__(self, scores = []): self.scores = scores inside the inheriting class, but it gives type error saying init() takes 1 or 2 positional arguments but 5 were given. well actually the parent class has init with 4 argument and i want another in this class with list. so what to do. pls help.

19th Oct 2017, 3:21 PM
Shantanu Shinde
Shantanu Shinde - avatar
2 Answers
+ 2
Can you show us the full code, so we can see parent class too. I'd like to help you.
19th Oct 2017, 3:47 PM
Tim Thuma
Tim Thuma - avatar
0
well I got it. I have to use that super().
19th Oct 2017, 4:14 PM
Shantanu Shinde
Shantanu Shinde - avatar