def BinReseach(x,nums):
low,high=0,len(nums)-1
while low<=high:
mid=(low+high)/2
if nums[mid]==x:
return mid
else:
if x<nums[mid]:
high=mid-1
else:
low=mid+1
if low>high:
return -1
l=[3,4,5,6,7,8,2]
m=int(input("please input your want to look number!"))#此处注意不能用raw_input()函数
s=BinReseach(m,l)
if s==-1:
print("not found!")
else:
print ("the nums is",s+1)
low,high=0,len(nums)-1
while low<=high:
mid=(low+high)/2
if nums[mid]==x:
return mid
else:
if x<nums[mid]:
high=mid-1
else:
low=mid+1
if low>high:
return -1
l=[3,4,5,6,7,8,2]
m=int(input("please input your want to look number!"))#此处注意不能用raw_input()函数
s=BinReseach(m,l)
if s==-1:
print("not found!")
else:
print ("the nums is",s+1)