Computer Science, asked by 57896, 1 year ago

PROGRAM next line ROGRA next line OGR next line G

Answers

Answered by paraskakkarlovp1ep4n
0
When we read files in Python, we want to detect empty lines and the file's end. When we call readline() we get the next line, if one exists.

With this method, we receive an unambiguous result. An empty string always means the end of the file has been reached. A newline string means a blank line was encountered.

An example program. Here we use a while-True loop. We must terminate the loop based on the result of the read line() method. We have 2 if-statements.

Similar questions