Python's range and xrange

range

  Function description: range([start,] stop[, step]), generate a sequence according to the range specified by start and stop and the step size set by step.

  range example:

>>> range(6)
[0, 1, 2, 3, 4, 5]
>>> range(0,6,2)
[0, 2, 4]

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324946642&siteId=291194637