python中range()函数用法
>>> range(10)
range(0, 10)
>>> list(range(10))
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> list(range(0,10,2))
[0, 2, 4, 6, 8]
>>> list(range(0,10,3))
[0, 3, 6, 9]
>>> list(range(1,10,3))
[1, 4, 7]
>>> list(range(10,0,-1))
[10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
>>> list(range(10,0,-2))
[10, 8, 6, 4, 2]
>>> list(range(10,-1,-2))
[10, 8, 6, 4, 2, 0]