l = [2,3,4,223,42,56,7,389,586,845,8,894,343,46,345,3556,23,233,45,25,78,456,785,576,344,6,34,563,] l.sort() print(l) def find(l ,aim,key=0): '''二分法找值 key的关键字是这个新序列的第一个元素在原序列的哪一个位置 mid_index 是新序列的的中值 ''' mid_index =len(l)//2 if len(l)<=1 and l[0] !=…