Consecutive Character Sequences
siona at chiark.greenend.org.uk
Thu Jul 14 16:08:36 CEST 2005
Aries Sun <sun.aries at gmail.com> wrote:
>I used Python 2.4.1, the following are the command lines.
>But the reslut was still False. Is there anything wrong with below
>>>> import itertools as it
>>>> def hasConsequent(aString, minConsequent):
> for _,group in it.groupby(aString):
> if len(list(group)) >= minConsequent:
> return True
> return False
Yes: return False is at the wrong indentation level.
\S -- siona at chiark.greenend.org.uk -- http://www.chaos.org.uk/~sion/
___ | "Frankly I have no feelings towards penguins one way or the other"
\X/ | -- Arthur C. Clarke
her nu becomeþ se bera eadward ofdun hlæddre heafdes bæce bump bump bump
More information about the Python-list