[1, 2] in [1, 2, 3] returns 0?
Sandy Norton
sandskyfly at hotmail.com
Sun Aug 26 09:10:37 EDT 2001
Peter Hansen <peter at engcorp.com> wrote in message news:<3B87FDE8.4CE63729 at engcorp.com>...
> >>> lst = [ 1, [1, 2], 2, 3]
> >>> sublst = [1,2]
> >>> sublst in lst
> 1
>
> Given the choice between the two, this one should be considered
> less surprising. Well, with 20-20 hindsight, anyway. :-)
Appreciate all the responses. I did feel incredibly stupid yesterday
until Eric S. Raymond asked something similar on Python-Dev recently
http://mail.python.org/pipermail/python-dev/2001-August/017299.html .
I guess I'm feeling better today...
Sandy
More information about the Python-list
mailing list