> I want to move all the 1's move to the right, 1 index at a time, > preserving any spacing.
So you want to insert a zero at the front and delete the first zero from the back? That doesn't require iterating over all the entries just enough to find the first zero... > [1,0,0,0,0,1,1,1,0,1,1,0,1,0] > ... > [0,0,0,0,0,0,0,1,1,1,1,1,1,1] And you can go straight to the last entry but counting the ones and building a new list, but that might not be acceptable for the game I dunno. Alan G. _______________________________________________ Tutor maillist - [email protected] http://mail.python.org/mailman/listinfo/tutor
