def search_linearw(a, x):
    """
    Returns the index of x in a if present, None elsewhere.
    """
    i = 0
    while i < len(a) and a[i] != x:
        i += 1
    if i == len(a):
        return None
    else:
        return i