On Wed, Jan 13, 2021 at 6:20 PM Dan Stromberg <drsali...@gmail.com> wrote:
> On Wed, Jan 13, 2021 at 5:59 PM Tim Chase <python.l...@tim.thechases.com> > wrote: > >> On 2021-01-13 21:20, Bischoop wrote: >> > I want to to display a number or an alphabet which appears mostly >> > consecutive in a given string or numbers or both >> > Examples >> > s= ' aabskaaabadcccc' >> > output: c >> > # c appears 4 consecutive times >> > 8bbakebaoa >> > output: b >> > #b appears 2 consecutive times >> > > I'm kind of partial to: > > import collections > import typing > > > def get_longest(string: str) -> typing.Tuple[int, str]: > I just realized this has a kinda big bug. Don't use! -- https://mail.python.org/mailman/listinfo/python-list