Consecutive Character Sequences

Aries Sun sun.aries at gmail.com
Thu Jul 14 08:41:11 EDT 2005


Hi George,
I used Python 2.4.1, the following are the command lines.
But the reslut was still False. Is there anything wrong with below
codes?

>>> import itertools as it
>>> def hasConsequent(aString, minConsequent):
	for _,group in it.groupby(aString):
		if len(list(group)) >= minConsequent:
			return True
		return False

	
>>> hasConsequent("taaypiqee88adbbba", 3)
False
>>> 

Regards,

Aries




More information about the Python-list mailing list