I have a list of labels for a data file,

test = ['depth', '4', '6', '10', '15', '20', '30', '40', 'angle']

I would like to get the string of the first value that is greater than a
known value and the previous string.

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.

I am having trouble with the mixed types.

for i in range(len(test)):
    if Field < int(test[i]):
        print i
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to