Possible Duplicates:
Iterate a list as pair (current, next) in Python
Iterating over every two elements in a list
Is it possible to iterate a list in the following way in Python (treat this code as pseudocode)?
a = [5, 7, 11, 4, 5]
for v, w in a:
print [v, w]
And it should produce
[5, 7]
[7, 11]
[11, 4]
[4, 5]