Python timeit doesn't works for list.remove operation
问题 I was trying to check the performance of remove operation in python list through the timeit module, but it throws a ValueError. In [4]: a = [1, 2, 3] In [5]: timeit a.remove(2) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-5-7b32a87ebb7a> in <module>() ----> 1 get_ipython().magic('timeit a.remove(2)') /home/amit/anaconda3/lib/python3.4/site-packages/IPython/core/interactiveshell.py in magic(self, arg_s)