import itertools


def pairwise(l):
    """Make a list of consecutive pairs given a list. 
    Example: [1,2,3] -> [(1,2),(2,3)]"""
    a, b = itertools.tee(l)
    next(b, None)
    return list(zip(a, b))