On Tue, Sep 29, 2015 at 01:54:44PM +1000, questions anon wrote: > thankyou but I just realised I wrote the question wrong - > > how do I do the inverse of above > so > hide 1 show 2,3,4 hide 5, show 6,7,8 etc. > > thanks in advance
A little more tricky. The version I showed using iter() and a while loop will work, but perhaps this is simpler: py> for i in range(0, len(a), 4): ... print(a[i+1:i+4]) ... [2, 3, 4] [6, 7, 8] [10, 11, 12] [14] -- Steve _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor