list comprehension method in python code example
Example 1: list comprehensions
h_letters = [ letter for letter in 'human' ]
print( h_letters)
Example 2: list comprehension
matrix = [[1, 2], [3,4], [5,6], [7,8]]
transpose = [[row[i] for row in matrix] for i in range(2)]
print (transpose)