I am trying to figure out how to use bisect in a list of tuples for example
[(3, 1), (2, 2), (5, 6)]
How can I divide this list in half according to [1] in each tuple?
list_dict [(69, 8), (70, 8), ((65, 67), 6)] tup1,tup2 (69, 8) (70, 8) list_dict [((65, 67), 6)] fst, snd ((65, 67),) (6,)
And I insert in bisect
idx = bisect.bisect(fst, tup1[1]+tup2[1])
Which gives me unorderable types: int() < tuple()
source share