不能只了解len函数,更重要的是要了解range函数。range(m, n, k)返回从m到n步长为k的可迭代对象。比如:
>>> list(range(10,-1,-1)) [10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]