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.
My Script is :
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)
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.
Second when I'm trying to print the count of array It's printing number of char.