[Tutor] re weird bool

2009-02-03 Thread prasad rao
helloyes.you are right. 2==True False It is an unexpected result to me. I thought any value other than 0 is True. And the solution provided by you(bool(a/1)) is useful to me. Thank you Prasad ___ Tutor maillist - Tutor@python.org

Re: [Tutor] re weird bool

2009-02-03 Thread Alan Gauld
prasad rao prasadarao...@gmail.com wrote 2==True False It is an unexpected result to me. I thought any value other than 0 is True. Any value of non zero is treated as True in a boolean context. But aq test of equality with a boolean value is not a boolean context. For equiality you have to