Skip to main contentSkip to solution

While working with text files, each line of a text file is terminated by a special character, called ________

Solution

✅ Correct Option: 2

In a text file, each line ends with a special character called EOL (End of Line). In Python, the default EOL character is the newline character \n.


Option 1: EOF marks the end of the whole file, not the end of each line.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question