Creating A Tuple From A List, Adding To Tuple As You Do

Karsten Heymann karsten.heymann at blue-cable.net
Thu Jun 5 15:55:20 CEST 2008


Hi Jeff,

Jeff Nyman <jeffnyman at gmail.com> writes:
> I did try this:
>
> for count in range(0, len(DC_List)):
>     DC_List.insert(count, '')

On additional note: You can be quite sure you'll never have to iterate
over the length of a list (or tuple) in python. Just iterate over the
list itself:

for DC in DC_List:
  # do something with DC.

Yours
Karsten



More information about the Python-list mailing list