I would like to create a default value in this python class. But when I try and do it I get an error that says, "self is not defined"
I know the answer is something simple, yet it eludes me at the moment. Anyone know why I cannot add a default parameter here?
Thanks in advance for your replies!
class Sort(object):
def __init__(self, lst):
self.lst = lst
def halve(self, l = self.lst):### this line <--------------
n1 = l[:len(l) / 2]
n2 = l[len(l) /2:]
return (n1,n2)