In python2:
>>> 'a' in ('ab')
True
>>> 'a' in ('ab', 'c')
False
If I just want to test whether certain string exists in given tuple, looks like I cannot use 'in' operator when the tuple size is 1? Is there a consistent way to do this?
updated:
Thanks everyone. Tried this:
>>> tup='ab',
>>> type(tup)
<type 'tuple'>
>>> 'a' in tup
False
and it explains comma makes a tuple well.