I simply began studying to code throughout quarantine and while studying python, I created this program for a binary search. That is actually fundamental so I assume that there’s a manner simpler technique. If anybody is aware of how I could make this manner easier, your assist could be appreciated.
record = [1,15,37,53,29,22,31,90,14,6,37,40] completed = False goal = 37 record.type() print(record) whereas completed == False: n = len(record) print(n) if goal < record[int(n/2)]: for objects in vary(int(n / 2), n): record.pop() print('Merchandise is just too massive.') elif goal == record[int(n/2)]: completed = True print('The merchandise has been discovered.') else: record.reverse() for objects in vary(int(n / 2), n): record.pop() record.reverse() print('Merchandise is just too small.') print(record)