String comparison

Mark McEahern marklists at
Wed Aug 21 19:00:33 CEST 2002

[David Iungerich]
> I'm new to Python.  I'm most comfortable with Java, but have done
> work in several other languages.  So far Python has proven rather
> annoying to deal with.

I'm sorry to hear that.  Minor suggestion:  Be specific about the problems
you're having.  And, starting off like the above is like walking into a
party, taking a turd in the punch bowl, and then asking, "Anybody have some


> I've also tried...

but you haven't even told us exactly what's wrong.  You're getting an error?
Or what you expect to compare equals is not?

Fire up the Python interpreter and make sure you feel comfortable with
what's happening:

$ python
Python 2.2.1 (#1, Jun 25 2002, 10:55:46)
[GCC 2.95.3-5 (cygwin special)] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> s = "a"
>>> t = "b"
>>> s == t
>>> p = "a"
>>> s == p

Gee, no surprises there.  So, again, please help us help you by being more
specific about the problem you're having and try to leave your attitude at
the door.


// mark


More information about the Python-list mailing list