title: Python - Fill an array from a file avoiding break line in the end
body: <p>I was searching for how to define an empty array and fill it using a text file and got stuck at one point and couldn't find the solution.</p>
  
  <p>My Script is :</p>
  
  <pre><code>array=[]
  file=open("path\\file.txt","r")
  array.append(file.readline())
  array.append(file.readline()) #wanted to put only first 2 line just for learning.
  incident_count=len(array)
  print(incident_count)
  print(array)
  </code></pre>
  
  <p>The first problem is that when I'm trying to put elements in array newline character is also attached("\n"). Also is append right function for putting elements in array.    </p>
  
  <p>Second when I'm trying to print the count of array It's printing number of char.</p>