> thanks everyone. only a question. there is a way to advantage of binary
> sequences?
I doubt you'll find any way to optimize the code that somehow only
applies to binary sequences. You still have to find each possible
subsequence of minimum length within the sequence and compare it to all
other
controlla("12345678") -> "12345678"
thanks everyone. only a question. there is a way to advantage of binary
sequences?
--
http://mail.python.org/mailman/listinfo/python-list
Hello.
> my target is implement a function controlla(string - a binary string-)
> that check if there is in a string two equal not overlapping
> subsequences at least of length limitem:
>
> my code:
> [snip]
>
I may have misunderstood it, but does your function work the way you
want it to?
>>>co
giampiero mu wrote:
> hi everyone
Hi, you appear to be fairly new to Python, so you might want to take a
look at the tutorial at Python.org
Kents suggestion to use RE is good.
This should be faster than your example by quite a bit if you don't want
to use RE.
def controlla(test, size=4):
giampiero mu wrote:
> hi everyone
>
> my target is implement a function controlla(string - a binary string-)
> that check if there is in a string two equal not overlapping
> subsequences at least of length limitem:
You can do this with a regular expression:
>>> import re
>>> r=re.compile(r'(?P
hi everyone
my target is implement a function controlla(string - a binary string-)
that check if there is in a string two equal not overlapping
subsequences at least of length limitem:
my code:
def controlla(test):
# print test
limitem=4
lunghezz=len(test)
l1=lungh