Commit a44ce733 by BellCodeEditor

auto save

parent 47281c3f
Showing with 5 additions and 6 deletions
import random
alist = [1,1,1,1,1,1,1,1,1,1,1,1,3,3,3,2,6,5,5,4]
for i in range(1, 101):
alist.append(i)
num = random.choice(alist)
alist = [1,2,3,4,5,6,7,8,9,0,11,111,11111,1111111,1111111111,111111111111111111,11111111111111111111111111111111111111,]
num = 111111#random.choice(alist)
# 请完善二分查找函数binary_search(),查找出num在列表alist里面的索引位置
def bbi(alist,num):
......@@ -21,4 +20,4 @@ def bbi(alist,num):
return None
result = bbi(alist,num)
print(result)
\ No newline at end of file
print(result , num)
\ 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