Commit 4b4ed19b by BellCodeEditor

save project

parent b5bef6f5
Showing with 6 additions and 22 deletions
import random
a=[]
for i in range(1,101):
a.append(i)
num = random.choice(a)
def b (alist,num):
low = 0
high=len(alist)-1
while low<=high:
mid=(low+high)//2
g=alist[mid]
if g == num:
return mid
elif g<num:
low=mid+1
elif g>num:
high=mid-1
return None
r=b(a,num)
print('数是:',num)
print('索引:',r )
\ No newline at end of file
import tkinter
root = tkinter.Tk()
root.title('注册')
root.geometry('400x320+500+300')
root.mainloop()
\ 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