def create_successive_pairs_from_list(alist):
    """
    Given a list like ["berlin", "leipzig", "dresden", "cottbus", "munich"]
    we want to create list of dictionary pairs as follows:
    [
        {"from": "berlin", "to": "leipzig"},
        {"from": "leipzig", "to",: "dresden"},
        {"from": "dresden", "to": "cottbus"},
        {"from": "cottbus", "to": "munich"},
    ]
    """
    my_pairs = []
    for index in range(len(alist)):
        if index < len(alist) - 1:
            my_pairs.append({"from": alist[index], "to": alist[index + 1]})
    return my_pairs