title: Why does write() method returns the length of string in IPython/Jupyter notebook?
body: <p>I've seen some strange (at least for me) behavior while using write() method in Ipython as well as Jupyter notebook:</p>
  
  <pre><code>In [1]: f = open('test.txt','w')
  In [2]: f.write("This is the first line")
  Out[2]: 22
  </code></pre>
  
  <p>It is actually returning the length of the string which I wrote in the file.</p>
  
  <p><em>I am bit curious about this behavior. Can someone please explain why this happens?</em></p>