In [2]:
def ran(N):
    for i in range(N):
        pass
In [3]:
def xran(N):
    for i in xrange(N):
        pass
In [4]:
%timeit ran(1000000)
10 loops, best of 3: 46 ms per loop
In [5]:
%timeit xran(1000000)
10 loops, best of 3: 29.6 ms per loop
In [ ]: