def link_to_list(link):
    """Takes a linked list and returns a Python list with the same elements.

    >>> link = Link(1, Link(2, Link(3, Link(4))))
    >>> link_to_list(link)
    [1, 2, 3, 4]
    >>> link_to_list(Link.empty)
    []
    """
    if link:
        link_list = [link.first] 

        while link.rest:
            link = link.rest
            link_list += [link.first]
        return link_list
    else:
        return []
    #return [link.first] + link_to_list(link.rest)