[Tutor] Comparing two lines of print

Michael Janssen Janssen at rz.uni-frankfurt.de
Thu Jun 3 06:36:21 EDT 2004

[self correcting me]

On Wed, 2 Jun 2004, Michael Janssen wrote:

> it's very likly due to the trailing newline: lines captured with
> raw_input have a newline (because you type ENTER).

as Bob has claimed in private mail, he didn't use raw_input. With further
investigations I have found out that "lines captured with raw_input"
doesn't have a newline. So to say, the part after the colon is rather
silly ;-) Perhaps I should have run my testcode myself.

OTOH line read in with the readline-method are likly to have a newline
(the last line in a file might be without newline). The reported problem
comparing lines with strings might be due to this.


More information about the Tutor mailing list