# 线性查找就是每个元素比较，相等即返回数据
def line_find(arr, value):
    for (index, key) in enumerate(arr):
        if key == value:
            return index
    return -1


if __name__ == '__main__':
    print(line_find([3, 5, 7, 2, 4], 2))

dcc4bbf10a7af5475435281df9d34feabcb11dc2
<mask token>

def line_find(arr, value):
    for index, key in enumerate(arr):
        if key == value:
            return index
    return -1


<mask token>

def line_find(arr, value):
    for index, key in enumerate(arr):
        if key == value:
            return index
    return -1


if __name__ == '__main__':
    print(line_find([3, 5, 7, 2, 4], 2))

# 线性查找就是每个元素比较，相等即返回数据
def line_find(arr, value):
    for (index, key) in enumerate(arr):
        if key == value:
            return index
    return -1


if __name__ == '__main__':
    print(line_find([3, 5, 7, 2, 4], 2))
