title: Take the content of a list and append it to another list
body: <p>I am trying to understand if it makes sense to take the content of a list and append it to another list.</p>
  
  <p>I have the first list created through a loop function, that will get specific lines out of a file and will save them in a list.</p>
  
  <p>Then a second list is used to save these lines, and start a new cycle over another file.</p>
  
  <p>My idea was to get the list once that the for cycle is done, dump it into the second list, then start a new cycle, dump the content of the first list again into the second but appending it, so the second list will be the sum of all the smaller list files created in my loop. The list has to be appended only if certain conditions met. </p>
  
  <p>It looks like something similar to this:</p>
  
  <pre><code># This is done for each log in my directory, i have a loop running
  for logs in mydir:
  
      for line in mylog:
          #...if the conditions are met
          list1.append(line)
  
      for item in list1:
          if "string" in item: #if somewhere in the list1 i have a match for a string
              list2.append(list1) # append every line in list1 to list2
              del list1 [:] # delete the content of the list1
              break
          else:
              del list1 [:] # delete the list content and start all over
  </code></pre>
  
  <p>Does this makes sense or should I go for a different route?</p>
  
  <p>I need something efficient that would not take up too many cycles, since the list of logs is long and each text file is pretty big; so I thought that the lists would fit the purpose.</p>