In Python is there a function for the "in" operator
Question: Is there any Python function for the "in" operator like what we have for
operator.lt, operator.gt, .. I wan't to use this function to do something
like:

    
    
    operator.in(5, [1,2,3,4,5,6])
    >> True
    
    operator.in(10, [1,2,3,4,5,6])
    >> False
    


Answer: Yes, use
[`operator.contains()`](https://docs.python.org/2/library/operator.html#operator.contains);
note that the order of operands is reversed:

    
    
    >>> import operator
    >>> operator.contains([1,2,3,4,5,6], 5)
    True
    >>> operator.contains([1,2,3,4,5,6], 10)
    False
    

You may have missed the handy [mapping
table](https://docs.python.org/2/library/operator.html#mapping-operators-to-
functions) at the bottom of the documentation.

