Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to move the element of an array in python by one step

def shift(key, array):
    counter = range(len(array)-1)
    new = counter
    for i in counter:
        new[i] = array[i-key]
    return new

print shift(1, [5, 6, 7])
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #move #element #array #python #step
ADD COMMENT
Topic
Name
5+5 =