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