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
You can use del on a slice: >>> a = [1,2,3,4,5,6,7,8,9,10,11,12,13,14] >>> del a[::4] >>> a [2, 3, 4, 6, 7, 8, 10, 11, 12, 14] As this modifies the list you may want to make a copy first. _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor