Co robi pętla for na liście w Pythonie?
Czy ktoś może wyjaśnić mi ostatni wiersz tego fragmentu kodu Pythona?
Cell
to kolejna klasa. Nie rozumiem, jakfor
pętla jest używana do przechowywaniaCell
obiekty wColumn
obiekt.
class Column(object):
def __init__(self, region, srcPos, pos):
self.region = region
self.cells = [Cell(self, i) for i in xrange(region.cellsPerCol)] #Please explain this line.