Chris Angelico :
> However, none of these will compare *equal* to the Boolean values True
> and False, save for the integers 1 and 0. In fact, True is a special
> form of the integer 1, and False is a special form of the integer 0;
Stirring the pot:
>>> (2 < 3) is True
True
but is that gu
ast wrote:
> Hello
>
> For integer, 0 is considered False and any other value True
>
A=0
A==False
> True
A==True
> False
A=1
A==False
> False
A==True
> True
>
> It works fine
But not the way you think:
>>> 0 == False
True
>>> 1 == True
True
>>> 2 == True
False
>>
Hello
For integer, 0 is considered False and any other value True
A=0
A==False
True
A==True
False
A=1
A==False
False
A==True
True
It works fine
For string, "" is considered False and any other value True,
but it doesn't work
A = ""
A==False
False
A==True
False
A = 'Z'
A==False
F