You can obtain a line from the keyboard with the
inputfunction, and you can process lines of a file. However “line” is used differently: With
inputPython reads through the newline you enter from the keyboard, but the newline (
'\n') is not included in the line returned by
input. It is dropped. When a line is taken from a file, the terminating newline is included as the last character (unless you are reading the final line of a file that happens to not have a newline at the end).