这里要注意的是//向下取整,下次循环时,如果大于查找的数字,start+1. 并且,只能向下取整,如果向上取整. 那么,在比较第一个数时,start = 0 .end = 1.mid = 1.就会进入死循环了. 切记切记. import math a_list = [2, 5, 23, 45, 67, 89, 90, 123, 234, 345, 567, 7890, 12132] guess_no = 67 answer = -1 start, end = 0, len(a_list) whi…