Comment Comment by montebicyclelo What's the advantage over the following?: for i in range(n): if search(i) == val: break raise KeyError("not found") found_index = i parent montebicyclelo 4 years ago