エラーはラインで発生します if data[l][0] == value:
def binary_pairs(data, value):
l = 0
h = len(data) - 1
while l < h and data[l]!= value:
m = (h + l) // 2
if data[m][0] == value:
l = m
elif data[m][0] < value:
l = m + 1
else:
h = m - 1
print("done")
if data[l][0] == value:
return l
else:
return -1
入力例: [ [ "dead", ["brian.txt","grail.txt"] ], [ "eunt", ["brian.txt"] ], [ "spank", ["grail.txt"] ] ]