<div dir="ltr"><div>I have a list of labels for a data file,</div>
<div> </div>
<div>test = ['depth', '4', '6', '10', '15', '20', '30', '40', 'angle']</div>
<div> </div>
<div>I would like to get the string of the first value that is greater than a known value and the previous string.</div>
<div> </div>
<div>If I have 15.8, I would like to get the index of '20' and '15'. I would also like to make sure that my known value falls in the range 4-40.</div>
<div> </div>
<div>I am having trouble with the mixed types.</div>
<div> </div>
<div>for i in range(len(test)):<br> if Field < int(test[i]):<br> print i</div>
<div> </div>
<div> </div>
<div> </div>
<div> </div></div>