Last active
February 22, 2017 13:23
-
-
Save forrestchang/4182afd33f75a7754ce992a6be725819 to your computer and use it in GitHub Desktop.
itertools.chain(*iterables)
This file contains hidden or 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
def chain(*iterables): | |
# chain('ABC', 'DEF') => A B C D E F | |
for it in iterables: | |
for element in it: | |
yield element |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment