Im using the following code to loop through an array.
arr = [1 ,2 ,3 ,4 ,5 , 6,7]
for a, b, c in zip(*[iter(arr)]*3):
print (a, b, c)
It retrieves the output in two parts as (1,2,3) and (4,5,6)
However I want the output to be consecutive in the sense (1,2,3),(2,3,4),(3,4,5),(4,5,6),(5,6,7) but also in a faster way. Is there any other way apart from iter to achieve this?