In <1110055534.040 063.304150@f14g 2000cwb.googleg roups.com>, italy wrote:
[color=blue]
> Why doesn't this statement execute in Python:
>
> 1 == not 0
>
> I get a syntax error, but I don't know why.[/color]
`==` has a higher precedence than `not` so Python interprets it as::
(1 == not) 0
This works::
[color=blue][color=green][color=darkred]
>>> 1 == (not 0)[/color][/color][/color]
True
italy wrote:[color=blue]
> Why doesn't this statement execute in Python:
>
> 1 == not 0
>
> I get a syntax error, but I don't know why.
>
> Thanks,
> Adam Roan[/color]
Of course, you would normally want to use != to see if something is not
equal to something else.
Comment