title: How to read and write integers from text file?
body: <p>float values into a file.
  When I try with .write() it takes the input as a string.
  I guess it's really basic of Python but I'm new to it.
  Hope you guys will not get angry with this question :D</p>
  
  <pre><code>with open('C:/Python35/sample.txt', 'w') as f:
      data = [70, 60, 55, 75, 95, 90, 80, 80, 85, 100]
      for i in data:
          f.write('%d \n' % i)
  
  with open('C:/Python35/sample.txt', 'r', encoding='utf-8') as g:
      data = g.readlines()
  
  print(data)
  </code></pre>
  
  <p>if I run this, I can get the result like below.</p>
  
  <pre><code>['70 \n', '60 \n', '55 \n', '75 \n', '95 \n', '90 \n', '80 \n', '80 \n', '85 \n', '100 \n']
  </code></pre>
  
  <p>It's the list of string, not the int values. 
  (And also wonder why there is '\n' in the 'data' list!)</p>