range() – This returns a list of numbers created using range() function. xrange() – This function returns the generator object that can be used to display numbers only by looping. Only particular range is displayed on demand and hence called “lazy evaluation“.Both are implemented in different ways and have different characteristics associated with them. The points of comparisons are: - Return Type - Memory - Operation Usage - Speedrange() returns – the list as return type. xrange() returns – xrange() object.
In Python 3, the original range function has been removed and renamed xrange to range.
range function returns a list of numbers created using range()