In [2]:
from timeit import timeit

In [3]:
tst_lst = [5, 5, 2]
%timeit tst_lst[1]

tst_dct = dict()
tst_dct[0] = 5
tst_dct[3] = 5
tst_dct[5] = 2
%timeit tst_dct[3]

x = 5
%timeit x


The slowest run took 16.53 times longer than the fastest. This could mean that an intermediate result is being cached 
10000000 loops, best of 3: 68.5 ns per loop
10000000 loops, best of 3: 75.7 ns per loop
10000000 loops, best of 3: 40.8 ns per loop