title: Python: converting list of lists to tuples of tuples
body: <p>A Python newbie! I need help converting a list of lists tuples of tuples.</p>
  
  <p>I want to call the append_as_tuples function, but every time I return it, it says<br>
  it can only concatenate lists (not tuples) to lists</p>
  
  <p>Here is what I have so far:</p>
  
  <pre><code>def append_as_tuple(t, l):
      ''' Convert list l to a tuple and append it to tuple t as a single value '''
      return t[:] + (tuple(l),)  
  
  def convert_lists(lol):
      t = []
      if type(lol) == a or type(lol) == tuple:
          return [convert_lists(lol) for i in t]
      return append_as_tuples(lol,a)
  
  #- test harness#
  
  a=[range(5), range(10,20), ['hello', 'goodbye']]  
  print a  
  print convert_lists(a)  
  print convert_lists([])  
  </code></pre>