Explain string boolean expression

Michal Wallace sabren at manifestation.com
Thu Nov 15 16:14:08 EST 2001


On Thu, 15 Nov 2001, Serg wrote:

> Explain please what exactly
> "" or "Some" or "abbyds"

Well, if you type it into the python prompt, you'd see
it prints "Some"... :)

"" is a false value, "Some" and "abbyds" are true values.

So it's the same as saying:

(false) or (something true) or (something else true)

And if you look at the order of operations, this compares
the first two, returns "something true" and forgets about
the the final value.

Cheers,

- Michal   http://www.sabren.net/   sabren at manifestation.com 
------------------------------------------------------------
Give your ideas the perfect home: http://www.cornerhost.com/
 cvs - weblogs - php - linux shell - perl/python/cgi - java
------------------------------------------------------------





More information about the Python-list mailing list