/dev/random

Circular Right Rotate

def rotate_right(L, k):
    """
    Circular right rotation of L, k times
    """
    M = L[:]
    for i, _ in enumerate(L):
        M[(i + k) % len(L)] = L[i]
    return M