Hi, I need some help to make a program where python reads each line(a string) of a .txt file.
-sample txt file-(EOF stands for 'End of File)
I need it to be able to read up to 300 students.
ID , Last , First, Lecture, Tutorial, A1, A2, A3, A4, A5
10034567, Smith, Winston, L01, T03, 6, 5.5, 8, 10, 8.5
10045678, Lee, Bruce, L02, T05, 4.5, 6.5, 7, 7, 8.5
00305678, Obama, Jack, L01, T05, 10, 10, 9, 9.5, 10
00567890, Brown, Palin, L02, T03, 4, 7.5, 6.5, 0, 5
10012134, Harper, Ed, L01, T03, 10, 9, 7.5, 10, 6.5
EOF
My problem is when I run the program, it doesn't stop!
Here's what I've done so far.
file = open ('grade.txt', 'r')
s=file.readline()
while s!="EOF":
lst=s.split(',')
print(lst)
s=file.readline()
print(s)