0 to n for loop code example Example: python for loop 0 to n def range_back(start,end): return chain(range(start,end),range(end,start,-1))