a good explanation

Nick Craig-Wood nick at craig-wood.com
Thu May 25 11:30:05 EDT 2006


mik3 <mik3l3374 at hotmail.com> wrote:
>  So he has written his first program in python and i have roughly toook
>  a glance at it and saw what he did.. i pointed out his "mistakes" but
>  couldn't convince him otherwise. Anyway , i am going to show him your
>  replies..

You might want to show him this too...if you happen to need cnt in the
loop, this is what you write

  files = [a,b,c,d]
  for cnt, fi in enumerate(files):
     do_something(cnt, fi)

-- 
Nick Craig-Wood <nick at craig-wood.com> -- http://www.craig-wood.com/nick



More information about the Python-list mailing list