Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Redd
def binary_search(item_list,item): first = 0 last = len(item_list)-1 found = False while( first<=last and not found): mid = (first + last)//2 if item_list[mid] == item : found = True else: if item < item_list[mid]: last = mid - 1 else: first = mid + 1 return found print(binary_search([1,2,3,5,8], 6)) print(binary_search([1,2,3,5,8], 5))
run
|
edit
|
history
|
help
0
PVJ-COMP1-1-EQUIPO1
shuru14
PyPoly
hi
Add missing persons
Game2
31 dec string
Считалка через массив
Pure Python Square root without using Math.sqrt()
E