Q:

How to loop over a circular list, while peeking ahead and behind current element? 

With the following example list: L = ['a','b','c','d']
I'd like to achieve the following output:
>>> a d b
>>> b a c
>>> c b d
>>> d c a

Pseudo-code would be:
for e in L:
    print(e, letter_before_e, letter_after_e

A:

You could just loop over L and take the index i minus and plus 1 modulo len(L) to get the previous and next element. 

A:

You're pretty much there
for i, e in enumerate(L):
    print(e, L[i-1], L[(i+1) % len(L)])

EDITED to add mod

