Using the in keyword is a shorthand for calling the __contains__ object __contains__ .
>>> a = [1, 2, 3] >>> 2 in a True >>> a.__contains__(2) True
Thus, ("0","1","2") in [0, 1, 2] asks if the tuple ("0", "1", "2") in the list [0, 1, 2] . The answer to this question is False . To be True , you will need to have a list like this:
>>> a = [1, 2, 3, ("0","1","2")] >>> ("0","1","2") in a True
Also note that the elements of your tuple are strings. You will probably want to check if any or all elements of your tuple are in your list after converting these elements to integers.
To check if all tuple elements (as integers) are contained in the list, use
>>> sltn = [1, 2, 3] >>> t = ("0", "2", "3") >>> set(map(int, t)).issubset(sltn) False
To check if any element of the tuple (as a whole) is contained in the list, you can use
>>> sltn_set = set(sltn) >>> any(int(x) in sltn_set for x in t) True
and use a lazy rating of any .
Of course, if your tuple contains strings for no particular reason, just use (1, 2, 3) and omit the conversion to int.