title: Error: <__main__.Node object at 0x03A5F990> while using linked-lists
body: <p>The following is a linked list implementation using Python:</p>
  <pre class="lang-py prettyprint-override"><code>class Node:
      def __init__(self,data,next):
          self.data = data
          self.next = next
  
  class List:
      head=None
      tail=None
      def printlist(self):
          print(&quot;list&quot;)
          a=self.head
          while a is not None:
                  print(a)
                  a=a.next
  
      def append(self, data):
          node = Node(data, None)
          if self.head is None:
              self.head = self.tail = node
          else:
              self.tail.next = node
          self.tail = node
  
  p=List()
  p.append(15)
  p.append(25)
  p.printlist()
  </code></pre>
  <p>Output:</p>
  <pre><code>list
  &lt;__main__.Node object at 0x03A9F970&gt;
  &lt;__main__.Node object at 0x03A9F990&gt;
  </code></pre>
  <p>To check your answer you need to edit this inbuilt method <code>def __repr__</code> and rewriting it.</p>
  <p>You can also do this by adding <code>__str__</code> method</p>