Skip to content

Instantly share code, notes, and snippets.

@fredrikbonander
Created May 29, 2013 12:05
Show Gist options
  • Save fredrikbonander/5669803 to your computer and use it in GitHub Desktop.
Save fredrikbonander/5669803 to your computer and use it in GitHub Desktop.
Find first matching
>>> [n for n in xrange(19) if n > 10]
[11, 12, 13, 14, 15, 16, 17, 18]
>>> next(n for n in xrange(19) if n > 10)
11
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment