*blink* That's neat.

Michal Wallace (sabren) sabren at manifestation.com
Tue May 30 11:58:23 CEST 2000


On Tue, 30 May 2000, Stephen Hansen wrote:

> While writing a function, I curiousely typed this into the Interpreter:
> 
> >>> if Case is not 0 or 1:
>         ....
> 
> etc..and it worked.. This was rather surprising to me :) Dunno why, but I
> expected I would have to write --> if Case is not 0 or Case is not 1:
> 
> Or: --> if Case != 1 or Case != 0
> 
> Okay, there's really no point to this post.. I was just surprised and had to
> tell someone, and my roommate really, really, REALLY didn't care. Not that
> anyoen here does either, but you can't give me an agitated look :)


um. In the words of Inigo Montoya: "I do not think it means what you 
think it means.."


>>> Case = 1
>>> if Case is not 0 or 1:
...    print "oops"
...
oops
>>>


Look at it again like this:  if (case is not 0) or (1)

Try this:

>>> Case = 1
>>> if Case is not in (0, 1):
...


Cheers,

- Michal
-------------------------------------------------------------------------
http://www.manifestation.com/         http://www.linkwatcher.com/metalog/
-------------------------------------------------------------------------





More information about the Python-list mailing list