Created
September 26, 2020 15:44
-
-
Save Kush1101/7da33eac1653ee4309241c4d4af6aeaa 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 chain | |
for i in chain([0,1,2,3], range(4,11), 'ABC'): | |
print(i, end = ' ') | |
#OUTPUT | |
''' | |
0 1 2 3 4 5 6 7 8 9 10 A B C | |
''' | |
my_iterable = [[0,1,2],[3,4],[5,6,7,8,9,10],['ABC']] | |
for i in chain.from_iterable(my_iterable): | |
print(i, end = ' ') | |
#OUTPUT | |
''' | |
0 1 2 3 4 5 6 7 8 9 10 ABC | |
''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment