a=[]
f=0
print("BINARY SEARCH")
print("ENTER NUMBERS IN ASCENDING ORDER")
for i in range(0,9):
k=int(input("ENTER THE ELEMENT AT ["+ str(i+1) +"]: "))
a.append(k)
s=int(input("ENTER A NUMBER TO BE SEARCHED: "))
#print(a[1])
#exit()
l=0
u=9
while[ l <= u ]:
m=int( (l + u) / 2)
if s==a[m]:
f=1
break
elif s>a[m]:
l = m + 1
else:
u = m - 1
if f==1:
print("FOUND "+str(s)+" at location "+str(m+1))
else:
print("NOT FOUND")
"NOT FOUND DOES NOT WORK"