Python short course: List Comprehensions
Today I'll put a simple list comprehension example here.
In [1]: list_example = [c*4 for c in 'Python']
In [2]: list_example
Out[2]: ['PPPP', 'yyyy', 'tttt', 'hhhh', 'oooo', 'nnnn']
Today I'll put a simple list comprehension example here.
In [1]: list_example = [c*4 for c in 'Python']
In [2]: list_example
Out[2]: ['PPPP', 'yyyy', 'tttt', 'hhhh', 'oooo', 'nnnn']
Comments
Post a Comment