for index in range(5): print (index, end=', ') print("\n") for index in range(1, 5): print(index, end=', ') print("\n") for index in range(1, 100, 3): print(index, end=', ')
參考資料:
http://docs.python.org/3/tutorial/controlflow.html#the-range-function
http://docs.python.org/3/library/stdtypes.html#range