"TGW" <galaxywatc...@gmail.com> wrote
I got it. I was comparing '345' to '345\n'

Adding the '\n' to the slice did indeed do the trick.

Yes, the problem is that the data in the file always has a \n at the end.
So you either have to rstrip() that off when you read it from the file or add a \n to your source data when comparing it with file data.

Personally I usually use strip() so that I'm working with 'clean' data
both for source and reference.

--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to