Number of cells, using CSV module

Tim Chase python.list at tim.thechases.com
Thu May 16 16:01:08 EDT 2013


On 2013-05-16 14:08, Skip Montanaro wrote:
> > So rather than
> >>a
> >>b
> >>c
> >>d
> >>e
> >>f
> > I would get [a, b, c, d, e, f]
> 
> all_items = []
> for row in reader:
>     all_items.append(row[0])

And following up here, this could be tidily rewritten as

  all_items = [row[0] for row in reader]

-tkc






More information about the Python-list mailing list