Both do the same job, difference is in their return type and memory type, execute below code and experience
r = range(0,19)
x = xrange(0,19)
range generates the sequence of number as list which consumes actual memory, however xrange() is just a generator which does not saves the entire range of numbers in memory as list.
Note : In python 3 range is same as xrange.