Created
April 21, 2012 05:59
-
-
Save anonymous/2434554 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import takewhile | |
big_list = [1, 2, 3, 4, 5,6, 6, 8, 9, 10] | |
less_than_9 = takewhile(lambda x: x < 9.0, big_list) | |
between_9_and_3 = (i for i in less_than_9 if i > 3.0) | |
for item in between_9_and_3: | |
print item |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment