newbie question - python lists

Robert P. J. Day rpjday at crashcourse.ca
Fri Nov 6 16:31:17 CET 2009


On Fri, 6 Nov 2009, lee wrote:

> hi,
>
> rfids= ['01','02']
> i = 01

  for what it's worth, that statement above isn't even legal python3.

> row = {}
> items = []
> for rfid in rfids:
>
>     brains = ['1','2']
>
>     if brains:
>         for brain in brains:
>             # this loop must run only once for each value of i
>             row['itemnos'] = 'item_0'+str(i)+'s'
>             print 'hi'
>             items.append(row)
>             print items
>             break
>     i=i+1

rday
--

========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA

            Linux Consulting, Training and Kernel Pedantry.

Web page:                                          http://crashcourse.ca
Twitter:                                       http://twitter.com/rpjday
========================================================================



More information about the Python-list mailing list