Commit 9cad4d65 by BellCodeEditor

save project

parent 5d275528
Showing with 3 additions and 3 deletions
...@@ -2,7 +2,7 @@ import random ...@@ -2,7 +2,7 @@ import random
a = [] a = []
for i in range(1, 101): for i in range(1, 101):
alist.append(i) a.append(i)
num = random.choice(alist) num = random.choice(alist)
# 请完善二分查找函数binary_search(),查找出num在列表alist里面的索引位置 # 请完善二分查找函数binary_search(),查找出num在列表alist里面的索引位置
g=random.choice(a) g=random.choice(a)
...@@ -17,4 +17,4 @@ def b(al,n): ...@@ -17,4 +17,4 @@ def b(al,n):
l=mid+1 l=mid+1
else: else:
r=mid-1 r=mid-1
print(b) print(b(a,g))
\ No newline at end of file \ 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