Python的range(n) 方法就是:
API定义: If you do need to iterate(迭代) over a sequence(一系列) of numbers, the built-in function range() comes in handy(方便的). It generates arithmetic progressions
如果确实需要迭代一组数字,那么内置函数range()就派上用场了。它生成算术级数。
个人:就是range(数字n),获取长度为数字n的tuple(元组)集合,可以通过list(tup)将元组转为list列组
例如:
range(10)表示: range(0, 10)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]