Find first in sequence (simple question)
lbates at swamisoft.com
Mon Sep 13 22:25:31 CEST 2004
One easy way (not tested):
# target value you are searching for
# nlist holds list of values to search
for value in nlist:
if value > target:
"Neal D. Becker" <ndbecker2 at verizon.net> wrote in message
news:mailman.3255.1095103389.5135.python-list at python.org...
> What is an efficient way to find the first element in a sequence meeting
> some condition?
> For example, the first number > x in a list of numbers.
More information about the Python-list