def linear_search(a, v):
    """Linear search algorithm. If v exist in a, returns index. Returns None if not found."""

    for index, e in enumerate(a):
        if e == v:
            return index
    return None