title: python Joining list elements into list of list
body: <p>I am attempting to join certain list elements in a specific manner:
  assuming i have following lists:</p>
  
  <pre><code>simpleline= [ 4 ]
  otherline= [ 5, 7 ]
  nextline=[ 1, 2 ]
  </code></pre>
  
  <p>i want to generate following lists:</p>
  
  <pre><code> middlelist=[ [ 4, 5 ] , [ 4, 7 ] ]
  </code></pre>
  
  <p>then finally:</p>
  
  <pre><code>finallist=[ [ 4, 5, 1] , [4, 7, 1] , [ 4, 5, 2 ] , [ 4, 7, 2 ] ]
  </code></pre>
  
  <p>i have attempted the first process in a cycle:</p>
  
  <pre><code>simpleline= [ 4 ]
  otherline= [ 5, 7 ]
  nextline=[ 1, 2 ]
  
  middlelist=[]
  for element in range(len(otherline)):
             snap=simpleline[0].append(otherline[element])
             middlelist.append(snap)
  
  print middlelist
  </code></pre>
  
  <p>however this results in error:</p>
  
  <pre><code> AttributeError: 'int' object has no attribute 'append'
  </code></pre>
  
  <p>i appreciate any help</p>