syntax question: "<>" and "!=" operators

Joe Grossberg josephgrossberg at hotmail.com
Fri Mar 15 13:13:02 EST 2002


Is there any effective difference between the two?

(Sorry if this has already been addressed; it's difficult to search on
punctuation.)

>>> name = "joe"
>>> name <> 'Joe'; name != 'Joe'; name <> 'joe'; name != 'joe'
1
1
0
0

Doesn't this violate the Python principle that " There should be
one--and preferably only one--obvious way to do it." if I'm
interpreting that correctly?



More information about the Python-list mailing list