title: Trouble inserting in Python (None vs. empty list)
body: <p>I'm trying to solve the following exercise from Google's Python class.</p>
  
  <p>E. Given two lists sorted in increasing order, create and return a merged list of all the elements in sorted order. You may modify the passed in lists. Ideally, the solution should work in "linear" time, making a single pass of both lists.</p>
  
  <p>I'm using the following Scheme approach (I wish I had car, cdr and cons!).</p>
  
  <pre><code>def helper(list1, list2, result):
    if list1 == None:
      return result + list2
    elif list2 == None:
      return result + list1
    elif list1[0] &lt; list2[0]:
      return helper(list1[1:], list2, result.insert(0, list1[0]))
    else:
      return helper(list1, list2[1:], result.insert(0, list2[0]))
  
  def linear_merge(list1, list2):
    helper(list1, list2, [])
  </code></pre>
  
  <p>The error I get is, I can't seem to insert an element into result when result is []:</p>
  
  <pre><code>AttributeError: 'NoneType' object has no attribute 'insert'
  </code></pre>
  
  <p>But that works fine in the console:</p>
  
  <pre><code>&gt;&gt;&gt; b = []
  []
  &gt;&gt;&gt; b.insert(0, 4)
  &gt;&gt;&gt; b
  [4]
  </code></pre>
  
  <p>I'm brand new to Python, so I have two questions:</p>
  
  <ol>
  <li>What am I missing about None vs. [], and how do I get this code to work?</li>
  <li>If Python wasn't meant for a Scheme/Lisp approach, what's the "Python way" of solving this?  This is less important to me, since I can just check the solutions.</li>
  </ol>
  
  <p>Thanks!</p>