I just learned that I can check if a substring is inside a string using:
substring in string
It looks to me that a string is just a special kind of tuple where its elements are chars. So I wonder if there's a straightforward way to search a slice of a tuple inside a tuple. The elements in the tuple can be of any type.
tupleslice in tuple
Now my related second question:
>>> tu = 12 ,23, 34,56
>>> tu[:2] in tu
False
I gather that I get False because (12, 23) is not an element of tu. But then, why substring in string works?. Is there syntactic sugar hidden behind scenes?.