[Tutor] Reading from files problem

R. Alan Monroe amonroe at columbus.rr.com
Mon Apr 20 03:11:40 CEST 2009


> 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



More information about the Tutor mailing list