If the iteration is being done for its side effect ( as it is in your “print” example ), then a loop is clearer.
If the iteration is executed in order to build a composite value, then list comprehensions are usually more readable.
More Related Contents:
- Line continuation for list comprehensions or generator expressions in python
- How to create the following lists with list comprehensions? [closed]
- if/else in a list comprehension
- Python’s most efficient way to choose longest string in list?
- What are the most common Python docstring formats? [closed]
- Using break in a list comprehension
- Nested For Loops Using List Comprehension
- How can I get around declaring an unused variable in a for loop?
- yield in list comprehensions and generator expressions
- Appending item to lists within a list comprehension
- Split a list into nested lists on a value
- How to frame two for loops in list comprehension python
- What do backticks mean to the Python interpreter? Example: `num`
- Recursive list comprehension in Python?
- Why results of map() and list comprehension are different? [duplicate]
- The truth value of an array with more than one element is ambigous when trying to index an array
- Python import mechanics
- list.extend and list comprehension [duplicate]
- Comprehension on a nested iterables?
- Is nested function a good approach when required by only one function? [closed]
- How can I use list comprehensions to process a nested list?
- How can I collect the results of a repeated calculation in a list, dictionary etc. (make a copy of a list with each element modified)?
- How can I create a list of elements from an iterator (convert the iterator to a list)?
- python list comprehension double for
- Are list comprehensions syntactic sugar for `list(generator expression)` in Python 3?
- Duplicate elements in a list [duplicate]
- Appending to a list comprehension in Python returns None [duplicate]
- Attributes initialization/declaration in Python class: where to place them?
- Optimal method to find the max of sublist items within list
- Why does PEP-8 specify a maximum line length of 79 characters? [closed]