Hi, DIY is easy.
On Mon, 27 Aug 2007 09:20:53 -0400, "Tino Dai" <[EMAIL PROTECTED]> said: > What I want to do is detect the 1,2,4 sequence and perhaps how many. >>> tset = [ 1,2,4,0,0,1,2,4,4] >>> s = [1, 2, 4] >>> c = 0 >>> for i in range(len(tset) - len(s)): ... if tset[i:i+len(s)] == s: ... c = c + 1 ... print "found at %d" % i ... found at 0 found at 5 >>> print c 2 Regards Lutz -- <http://www.fastmail.fm/mail/?STKI=600622> _______________________________________________ Tutor maillist - [email protected] http://mail.python.org/mailman/listinfo/tutor
