count consecutive elements

Tim Chase python.list at tim.thechases.com
Fri Jan 15 23:09:55 EST 2021


On 2021-01-16 03:32, Bischoop wrote:
>> The OP didn't specify what should happen in that case, so it would
>> need some clarification.
> 
> In that case maybe good solution would be to return three of them?

That's the solution I chose in my initial reply, you get a tuple back
of ([list of longest matches], length_of_longest_match)

-tkc




More information about the Python-list mailing list