title: write on newline in a text file on each iteration using python
body: <p>want to write in newline in each iteration but it does not work out. i read random string using function getUser() and getFriends() from abc.txt. And write  in text file new_file.txt but it writes in first line in each iteration</p>
  
  <p>output:['Larina'] ['Oormi', 'Palky']['Kavia'] ['Chakradhari', 'Chunni']</p>
  
  <p>i need in this format:</p>
  
  <p>['Larina'] ['Oormi', 'Palky']</p>
  
  <p>['Kavia'] ['Chakradhari', 'Chunni']</p>
  
  <pre><code>with open("new_file.txt", "wb") as sink:
          for i in range(0,2):
              print&gt;&gt;sink, getUser(),getFriends()
              #print&gt;&gt;sink,("\n")
  
  def getUser():
      with open("abc.txt", "rb") as source:
          lines = [line.rstrip() for line in source]
      random_choice = random.sample(lines, 1)
      source.close()
      return(random_choice);
  def getFriends():
      with open("abc.txt", "rb") as source:
          lines = source.read().splitlines()
  
      random_choice = random.sample(lines, 2)
      source.close()
      return(random_choice);
  </code></pre>