circular array python

array[i % len(array)]

Here is what the above code is Doing:
1. We create a list of integers from 0 to len(array) – 1.
2. We use the modulo operator to wrap around the list.
3. We use the modulo operator to wrap around the array.
4. We return the element at the index we wrapped around to.