source:
https://www.quora.com/What-is-the-difference-between-range-and-xrange-how-has-this-changed-over-time
In python 2.x range() returns a list and xrange() returns an xrange object, which is kind of like an iterator and generates the numbers on demand.
In python 3.x xrange() has been removed and range() now works like xrange() and returns a range object.
Happy coding.