From 71d24d186871d3a76acdf13c7ad194fbc6613bf9 Mon Sep 17 00:00:00 2001 From: Zhongheng Liu Date: Tue, 8 Oct 2024 12:29:10 +0000 Subject: feat: not workin --- lesson1.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'lesson1.py') diff --git a/lesson1.py b/lesson1.py index 24e409f..c2c59f4 100644 --- a/lesson1.py +++ b/lesson1.py @@ -12,12 +12,9 @@ def binsearch(arr: list, item): while not found and lbound <= ubound: index = (lbound + ubound) // 2 if lbound == ubound: - if arr[lbound] == item: + if arr[index] == item: found = True print("Found here") - break - else: - break if arr[index] > item: ubound = index - 1 if arr[index] < item: -- cgit