Computer Science, asked by hrs004april, 1 month ago

n=int(input("Enter list size:"))
a=[]
for i in range(n):
val=int(input("Enter no.:"))
a.append(val)
key=int(input("Enter Value to find:"))
def binary_search(a,n,key):
i=0
j=n-1
flag=0
while i key:
j=mid-1
if a[mid] i=mid+1
if flag==1:
print("No. Found at",pos)
else:
print("No. not found")
------------------------------------------------------------------------
it shows I have not defined but I did

Answers

Answered by atrs7391
0

You have not defined variable mid before.

Answered by vanshpandey928
0

Answer:

ummm i think your identation is wrong try doing that :)

Explanation:

you have not defined MID

Similar questions