9
QuizMultiple Choice

Test: Programming Algorithms

Question 9 • Intro to Computer Science B

How does a file reader know where one line starts and another ends?

Answer
A
Python knows how many characters to expect in a line.
B
Every line in a text file has a hidden EOL (end of line) set of characters.
C
The last item in a line of data does not have a comma after it.
D
Every line starts with a BOL (beginning of line) character.

Explanation

A text file marks the end of a line with an end-of-line sequence, usually a newline character (or a pair of characters, depending on the system). The file reader detects that marker and treats the text after it as the next line. Python does not need to know a line’s length in advance.

AI-written and checked against the verified answer.

Previous
Next