225k views
16 votes
How does a file reader know where one line starts and another ends?

Every line in a text file has a hidden EOL (end of line) set of characters.

Python knows how many characters to expect in a line.

The last item in a line of data does not have a comma after it.

Every line starts with a BOL (beginning of line) character.

User Yasskier
by
4.9k points

1 Answer

7 votes

Answer:

Every line in a text file has a hidden EOL (end of line) set of characters.

Step-by-step explanation:

The EOL characters are CR+LF, a.k.a. carriage return (13) + line feed (10).

Some text files only use LF characters to denote a line ending.

User GreatWiz
by
5.8k points