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
0
You have not defined variable mid before.
Answered by
0
Answer:
ummm i think your identation is wrong try doing that :)
Explanation:
you have not defined MID
Similar questions
CBSE BOARD XII,
2 months ago
History,
2 months ago
Math,
4 months ago
Physics,
11 months ago
Math,
11 months ago