diff --git a/Student_Names.py b/Student_Names.py index c6bf448..12a32ee 100644 --- a/Student_Names.py +++ b/Student_Names.py @@ -1,8 +1,10 @@ -s = open('studentnames.txt', 'r') -print(s.readline().rstrip('\n')) -print(s.readline().rstrip('\n')) -print(s.readline().rstrip('\n')) -print(s.readline().rstrip('\n')) -print(s.readline().rstrip('\n')) -print(s.readline().rstrip('\n')) +s = open('StudentNames.txt', 'r') +tmp=s.readline().rstrip('\n') +print(tmp) +count=1 +while(tmp!=""): + tmp=s.readline().rstrip('\n') + print(tmp) + count+=1 +print(count) s.close() \ No newline at end of file