def cycle_list(k, n):
 k = (k % n)
 return (list(range(k, n)) + list(range(k)))

def cycle_list ( k , n ) : k = ( k % n ) return ( list ( range ( k , n ) ) + list ( range ( k ) ) )
returns the elements of the list range(n) shifted to the left by k (so the list starts with k ) .