1 > 0 == True -> False

Chris Angelico rosuav at gmail.com
Thu Jan 30 15:25:25 EST 2014


On Fri, Jan 31, 2014 at 7:14 AM, Jussi Piitulainen
<jpiitula at ling.helsinki.fi> wrote:
>> I don't think any number of parentheses will help that :-)
>
> Er, sorry about that. Here:
>
>>>> x <= y < z == w
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> NameError: name 'x' is not defined
>
> Much better :)

See, you still all think the solution is with parentheses and stuff.
It's not. The solution is with apostrophes - look!

>>> 'x' <= 'y < z == w'
True

Now it works!

ChrisA



More information about the Python-list mailing list