List comprehension is a powerful and concise method for creating lists in Python that becomes essential the more you work with lists, and lists of lists
Notes about Lists Comprehensions
List comprehension methods are an elegant way to create and manage lists. In Python, list comprehensions are a more compact way of creating lists. More flexible than for loops, list comprehension is usually faster than other methods.
syntax:
my_new_list = [ expression for item in list ]
examples:
# open the file in read-only mode
file = open("dreams.txt", 'r')
poem = [ line for line in file ]
for line in poem:
print(line)