so how would I check to see if the student number entered by the user matches one of the student numbers in the file and then display that students info?
On 4/19/09, R. Alan Monroe <[email protected]> wrote: > >> gradesfile = open("grades.dat", "r >> for lines in gradesfile: >> [snip] >> That's what I have so far but I have a feeling I shouldn't use a for >> loop. > > Actually a for loop seems like the right tool for this job, assuming > you really _do_ want to process every line in the file. > > Alan > > _______________________________________________ > Tutor maillist - [email protected] > http://mail.python.org/mailman/listinfo/tutor > _______________________________________________ Tutor maillist - [email protected] http://mail.python.org/mailman/listinfo/tutor
