python said : "1, 2, 3, 6, 7, manbo !"
Miki Tebeka
miki.tebeka at zoran.com
Thu Jan 22 02:35:19 EST 2004
- Previous message (by thread): python said : "1, 2, 3, 6, 7, manbo !"
- Next message (by thread): python said : "1, 2, 3, 6, 7, manbo !"
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Hello Rodrigo,
> >>> a = range(8)
> >>> for b in a:
> if b == 4:
> a.remove(b)
> else:
> print b
try:
a = range(8)
for b in list(a): # Iterate over a shallow copy
if b == 4:
a.remove(b)
else:
print b
0
1
2
3
5
6
7
HTH.
Miki
- Previous message (by thread): python said : "1, 2, 3, 6, 7, manbo !"
- Next message (by thread): python said : "1, 2, 3, 6, 7, manbo !"
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Python-list
mailing list