Use range instead of xrange.

r?