Created
January 30, 2020 17:02
-
-
Save jvorcak/c99051beb83d9eae3570e21f15bcafb4 to your computer and use it in GitHub Desktop.
Python join for objects
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 chain | |
list(chain.from_iterable((a, 1) for a in ['a', 'b', 'c']))[:-1] | |
Out: ['a', 1, 'b', 1, 'c'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment