assigning values to array element
Michael Peuser
mpeuser at web.de
Wed Oct 15 02:24:56 EDT 2003
More information about the Python-list mailing list
Wed Oct 15 02:24:56 EDT 2003
- Previous message (by thread): assigning values to array element
- Next message (by thread): Z in ZOPE
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"Ben" <crescent_au at yahoo.com> > > This may sound easy but I'm having trouble assigning values to array > element. My problem is as follows: > > m = ['Peter', 'Sam', 'Dave', 'Carl'] > for o in m: > # Here first o is 'Peter'.. I want to do something like this: > Peter = 10 > > # if i do %s %o = 10, it gives me error... > > How can I do it? I think 'old stuff' is really appropriate here: for index in xrange(len(m)): m[index]=10 Kindly MichaelP
- Previous message (by thread): assigning values to array element
- Next message (by thread): Z in ZOPE
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list