title: I want to write to a new file not append for every iteration
body: <p>I want to create a new file for each iteration, but I'm not able to do so. I'm only able to update the same old file, how could I solve this? </p>
  
  <p>The other more basic question what is "" function in file.write("".)?
  I have tried with "w" but it still doesn't work..</p>
  
  <p>Here is my code:</p>
  
  <pre><code> def write_to_file(self,lista): 
      file=open("file.txt","a") 
      file.write("\n")
      file.write("".join(str(lista)))
      file.close()  
  </code></pre>