《Python 第六章》抽象
--------67.py----------- #!/usr/bin/python # filename : interval def interval(start, stop = None, step = 1) : if stop is None : stop = 10 result = [] i = start while i < stop : result.append(i) i += step print result return result interval(1) interval(1, 5) interval(2, 20, 3) 慎重使用全局变量