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']

Comments

Popular posts from this blog

Lab's weekly topic - week 50 2023 - Detailed explanation for encoder of U-Net

Lab's recommendation: Awesome books to learn machine learning and AI (continue updating)