Bug?

Ricardo Correia google.com at wizemail1.cjb.net
Tue Jul 24 20:39:50 EDT 2001


Hi

---------------------------------------------------
mainlist = [1, 2, 3, 4, 5]
copy = mainlist

for item in copy:
 print item,
 mainlist.remove(item)
---------------------------------------------------

Shouldn't this produce '1 2 3 4 5'?

I only get '1 3 5' and unfortunately because of this my program doesn't work.

I'm using python 2.0 (the one that comes with Mandrake 8.0)

Thanks

Ricardo Correia



More information about the Python-list mailing list