Python, concise way to test membership in collection using partial match
Posted
by aaa
on Stack Overflow
See other posts from Stack Overflow
or by aaa
Published on 2010-04-23T05:35:00Z
Indexed on
2010/04/23
5:43 UTC
Read the original article
Hit count: 240
hello.
What is the pythonic way to test if there is a tuple starting with another tuple in collection? actually, I am really after the index of match, but I can probably figure out from test example
for example:
c = ((0,1),(2,3))
# (0,) should match first element, (3,)should match no element
I should add my python is 2.4 and/or 2.5
thanks
© Stack Overflow or respective owner