how to explain such codes, python's bug or mine?

MaHahaXixi enjoy_linux at hotmail.com
Thu Apr 14 02:03:20 EDT 2005


yes, i use the 2th way
<ajikoe at gmail.com> wrote in message
news:1113389164.495602.86170 at f14g2000cwb.googlegroups.com...
> Hi
>
> The second style can be used:
>    j = range(20)
>   print j
>   L = [x for x in j if x > 10]
>   j = L
>
> There are another method such poping the item based on last index to 0:
>  for i in range(len(j)-1,0-1,-1):
>     if j[i]<=10:
>       j.pop(i)
>
>  print j
>
> Pujo
>





More information about the Python-list mailing list