So, I notice that calling array[:-1]
is going to clone the array.
Say I have a large array with like 3000 elements in it. I don't want it to be cloned as I iterate over it! I just want to iterate to the 2nd last one.
for item in array[ :-1 ] :
# do something with the item
So do I have to resort to a counter variable,
for c in range( 0, len( array ) - 1 ) :
# do something with array[ c ]
or is there way to make/will array[:-1]
syntax be efficient?