[Tutor] beginner question

Mayo Adams mayoadams at gmail.com
Tue Nov 1 16:34:07 CET 2011

When writing a simple for loop like so:

     for x in f

where f is the name of a file object, how does Python "know" to interpret
the variable x as a line of text, rather than,say, an individual character
in the file? Does it automatically
treat text files as sequences of lines?

Mayo Adams

287 Erwin Rd.
Chapel Hill, NC 27514
mayoadams at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20111101/8abd7c4f/attachment.html>

More information about the Tutor mailing list