title: Is it better to file.write() or to print to file?
body: <p>To write to a file called "file.txt", I can either use:</p>
  
  <pre><code>with open('file.txt', 'a') as file:
      file.write('some text')
  </code></pre>
  
  <p>or :</p>
  
  <pre><code>with open('file.txt', 'a') as file:
      print('some text', file=file)
  </code></pre>
  
  <p>What are the advantages/disadvantages of each? Are they essentially the same?</p>