assigning values to array element

Ben crescent_au at yahoo.com
Tue Oct 14 21:34:42 EDT 2003


Hi all,

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?

Thanks
Ben




More information about the Python-list mailing list