107,330 views
16 votes
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 Memduh
by
2.2k points

1 Answer

10 votes
10 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 Arunbh Yashaswi
by
3.0k points