Commit 823c0c7f by BellCodeEditor

auto save

parent 529365c8
Showing with 4 additions and 4 deletions
import random
alist = []
alist1 = []
for i in range(1, 101):
alist.append(i)
num = random.choice(alist)
alist1.append(i)
num1 = random.choice(alist1)
# 请完善二分查找函数binary_search(),查找出num在列表alist里面的索引位置
def binary_search(alist,num):
......@@ -19,7 +19,7 @@ def binary_search(alist,num):
else:
high = mid - 1
r = binary_search(alist,num)
r = binary_search(alist1,num1)
print(r)
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