title: How can I recursively add to a linked list in Python?
body: <p>I have trouble using recursion with linked lists. 
  I want to be able to add another node to an ordered linked list. </p>
  
  <p>I have this class:</p>
  
  <pre><code>class Link:
      def __init__(self,value,next=None):
          self.value = value
          self.next  = next
  </code></pre>
  
  <p>Below is the recursive function, that so far doesn't do much except identifying base cases</p>
  
  <p>Note: it's not a method in <code>Link</code>, it's a separate function:</p>
  
  <pre><code>def add(ll, v):
      if ll == None:
          return Link(v)
      else:
           ll.next = add(ll.next,v)
           return ll
  </code></pre>
  
  <p>Example: I have this linked list <code>A</code>: </p>
  
  <pre><code>1-&gt;3-&gt;8-&gt;12-&gt;None
  </code></pre>
  
  <p>I call <code>add(A, 10)</code> which should add 10 in the right order. </p>
  
  <pre><code>1-&gt;3-&gt;8-&gt;10-&gt;12-&gt;None
  </code></pre>
  
  <p>How should I modify my code to make that work?</p>