Slaunger <[EMAIL PROTECTED]> writes:

> I am a Python novice, and I have run into a problem in a project I am
> working on, which boils down to identifying the patterns in a sequence
> of integers, for example
>
> .... 1 6 6 1 6 6 1 6 6 1 6 6 1 6 6 1 9 3 3 0 3 3 0 3 3 0 3 3 0 10 6 6
> 1 6 6 1 6 6 1 6 6 1 6 6 1 6 6 1 6 6 1 9 3 3 0 3 3 0 3 3 0 3 3 0 10 6 6
> 1 6 6 1 6 6 1 6 6 1 6 6 1 6 6 1 6 6 1 9 3 3 0 3 3 0 3 3 0 3 3 0 10 6 6
> 1 6 6 1 6 6 1 6 6 1 6 6 1 6 6 1 6 6 1 9 3 3 0 3 3 0 3 3 0 3 3 0 10 6 6
> 1 6 6 1 6 6 1 6 6 1 6 6 1 6 6 1 6 6 1 ...
>
> I want to process this such that I get out two patterns, like:
> (9, 3, 3, 0, 3, 3, 0, 3, 3, 0, 3, 3, 0)
> and
> (10, 6, 6, 1, 6, 6, 1, 6, 6, 1, 6, 6, 1, 6, 6, 1, 6, 6, 1, 6, 6, 1)
>
> I am pretty sure I can figure out how to do that, but I would like to
> have some guidance on the most pythonic approach to this.

Then it would be a good starting point to write some code. Then you
could post it and ask how it can be made more 'pythonic'.

HTH

-- 
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to