Apr-19-2018, 04:55 PM
xrange in python2 is just a generator. In python3, it's a special class that normally acts like a generator, but also supports slicing/indexing/min/max/len, using math to calculate what those values would be (instead of exhausting the range), so it's still very fast.