cell and row

Shi Mu samrobertsmith at gmail.com
Tue Oct 25 04:50:28 EDT 2005


I can not understand the use of "cell" and "row" in the code:

# convert the matrix to a 1D list
matrix = [[13,2,3,4,5],[0,10,6,0,0],[7,0,0,0,9]]
items = [cell for row in matrix for cell in row]
print items



More information about the Python-list mailing list