Commit ae039df4 by BellCodeEditor

save project

parent 92449b0c
Showing with 15 additions and 5 deletions
list1 = [] def diy(alist,number):
for a in range(0, 1000): low = 0
for b in range(0, 1000): high = len(alist) - 1
list1.insert(0, 0) while low <= high:
\ No newline at end of file mid = (low + high)
guess = alist[mid]
if guess == number:
return mid
elif guess < number:
low = mid + 1
else:
high = mid - 1
diy([1,2,3,4,5,6,7,8],5)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment