<jupyter_start><jupyter_text>Official Documentation : https://docs.python.org/2/library/operator.html<jupyter_code>import operator 
print operator.mul(5,6)
print operator.add(5,6)
print operator.sub(5,6)
print operator.ge(5,6)
print operator.lt(5,6)
print operator.le(5,5)
print operator.div(5.0,6)
print operator.floordiv(5.0,6)
print operator.countOf([1, 2, 1, 2, 3, 1, 1], 1)
print operator.contains([1, 2, 1, 2, 3, 1, 1], 1)
print operator.indexOf([1, 2, 1, 2, 3, 1, 1], 3)<jupyter_output>4<jupyter_text>Passing to Higher Order Functions<jupyter_code>my_list = [(1, "Hello"), (200, "World"), (50, "Yolo"), (170, "XOXO")]
sorted(my_list, key=operator.itemgetter(1), reverse=True)<jupyter_output><empty_output><jupyter_text>Performance speedups<jupyter_code>import timeit
timeit.timeit('reduce(lambda x,y : x*y, range(1,100))')
timeit.timeit('reduce(mul, range(1,100))',setup='from operator import mul')<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup