View Single Post
Old May 3rd, 2008, 5:33 PM   #6
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,788
Rep Power: 5 Sane will become famous soon enough
Re: Are nested lists indestructable?

Wait, what? Hold on a tick. Divide by 4?

If you just want the number of lists, then use the len function...

len(abspirlist)

That will give you 3 in my example.

And in the code you posted, don't do:

del abspirlist[:dice]

Reassign your array in the same manner I showed you in my second post.

x = x[a:]   # Will keep all elements from the a'th element to the end
x = x[:a]   # Will keep all elements until the a'th element
Sane is online now   Reply With Quote