📜  如何在python中一步移动数组的元素 - Python代码示例

📅  最后修改于: 2022-03-11 14:46:26.737000             🧑  作者: Mango

代码示例1
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])