I have a nested list
l1 = [ [0.1*x, 0.5*x] for x in range(6) ]
which gives
[[0.0, 0.0], [0.1, 0.5], [0.2, 1.0], [0.3, 1.5], [0.4, 2.0], [0.5, 2.5]]
Let's say val=0.35
is a variable. I am trying to find smallest index x
such that of l1[x][0]>val
, which is 4
in this case.
I want to use the iterator approach given here: https://stackoverflow.com/a/2236935/11638153