class DLLNode(object):
def __init__(self, data, prev_link, next_link):
self.data = data
self.prev_link = prev_link
self.next_link = next_link
class DoublyLinkedList(object):
def __init__(self):
self.head=None
self.tail=None
def add_head(self, add_obj):
self.head=DLLNode(add_obj,None,self.head)
>>> x=DoublyLinkedList
>>> x.add_head(1)
Traceback (most recent call last):
File "<pyshell#20>", line 1, in <module>
x.add_head(1)
TypeError: add_head() takes exactly 2 arguments (1 given)