def linear_search(lst, val): for index, value in enumerate(lst): if value == val: return index else: return None