def maopao(list):
for i in range(0, len(list)):
print(' At present i=',i)
for j in range(0, len(list)-i-1):
print(' At present j=', j)
if list[j] > list[j+1]:
list[j] ,list[j+1]= list[j+1],list[j]
print(' Bubble sorted list :', list)
return list
def twofenfa(list,num):
low=0
high=len(list)-1
while low<=high:
mid=int((low+high)/2)
if num < list[mid]:
high=mid-1
elif num > list[mid]:
low=mid+1
elif num == list[mid]:
return mid
if __name__ == '__main__':
list_shuzi = eval(input("enter my list:"))
print(' The index of the currently searched number is :',twofenfa(maopao(list_shuzi), 67))