What Is Output Of Following Python C.ode?
Answers
Answered by
20
Answer:
After Running Above Python C.ode The Output produced is Given in The Above Attachment.
Python Version is Python IDLE 3.8.6 shell
The Answer is an Original answer by Me.
after Interpreting C.odes .
Attachments:
Answered by
0
Answer:
")defbinsearch(ar,key):
low=0
high=len(ar)-1
while low<=high:
mid=int((low+high)/2)
if key==ar[mid]:
return mid
elif key<ar[mid]:
high=mid-1
else:
low=mid+1
else:
return-999
ar=[12,15,21,25,28,32,33,36,43,45]
item=int(input("enter search item:"))
res=binsearch(ar,item)
if res>=0:
print(item,"FOUND at index",res)
else:
print("sorry!",item,"NOT FOUND in array
Similar questions
Social Sciences,
1 month ago
Hindi,
1 month ago
Economy,
2 months ago
Physics,
10 months ago
Chemistry,
10 months ago