summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhongheng Liu <z.liu@outlook.com.gr>2024-10-08 12:29:10 +0000
committerZhongheng Liu <z.liu@outlook.com.gr>2024-10-08 12:29:10 +0000
commit71d24d186871d3a76acdf13c7ad194fbc6613bf9 (patch)
treed267d7635bb5b917beb9e6c17bdb1feb1c401da7
parent2c53f7b157233bd82023b1280ade5017eb243f77 (diff)
downloadcs-y13-71d24d186871d3a76acdf13c7ad194fbc6613bf9.tar.gz
cs-y13-71d24d186871d3a76acdf13c7ad194fbc6613bf9.tar.bz2
cs-y13-71d24d186871d3a76acdf13c7ad194fbc6613bf9.zip
feat: not workin
-rw-r--r--lesson1.py5
1 files changed, 1 insertions, 4 deletions
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: