Quote (eric838 @ May 24 2014 11:08pm)
ok fixed but got another problem
i got a list like that [[0,0,0,0,0], [0,0,0,0,1], [0,0,0,0,2], [0,0,0,0,3],[0,0,0,0,5],...[7,7,7,7,7]]
if i remove at range 1,2,3 on the list i got [[0,0,0,0,0], [], [], [],[0,0,0,0,5],...[7,7,7,7,7]] but I would like to be removed like this [[0,0,0,0,0],[0,0,0,0,5],...[7,7,7,7,7]]
is it possible without if len(totall[z])>0:
because it may rand an empty list
remove should do it.
Quote
Python 2.7.5+ (default, Sep 19 2013, 13:48:49)
[GCC 4.8.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> mylist = ['first', 'second']
>>> mylist
['first', 'second']
>>> mylist.remove('first')
>>> mylist
['second']
/edit: or by index use del
Quote
>>> mylist = ['first', 'second']
>>> mylist
['first', 'second']
>>> del mylist[0]
>>> mylist
['second']
>>>
This post was edited by carteblanche on May 24 2014 09:24pm