+ 1
Why " return "statement is not used in LINE 7
2 Answers
+ 4
There is no return, because you never have to print its result, you just edit the list.
The "return" on line 5 also doesn't have to be there.
So the class can be:
...
def add(self,a):
self.n.append(a)
def remove(self,b):
self.n.remove(b)
def dis(self):
return self.n
...
And the "return" on line 9 must be there, because when you run "dis" function, you want to print its result. If there will be no return it will just result in None.
+ 1
Oh.. thank u..
There is not need for return in line 5 as well
Now I m clear.. thanks