In Python 2.x range() method returns a whole list of numbers while xrange() returns a generator. Later this generator can be used to get numbers one by one in a so-called lazy evaluation manner. In Python 3 described range() method was deprecated and xrange() method was renamed to range().
Login in to like
Login in to comment