Hi, >From https://docs.python.org/3/library/stdtypes.html#str.count: str.count(*sub*[, *start*[, *end*]])
Return the number of *non-overlapping* occurrences of substring *sub* in the range [*start*, *end*]. Optional arguments *start* and *end* are interpreted as in slice notation. Best regards, João Santos On Wed, 25 Apr 2018 at 20:22 Julia Kim <[email protected]> wrote: > Hi, > > There’s an error with the string method count(). > > x = ‘AAA’ > y = ‘AA’ > print(x.count(y)) > > The output is 1, instead of 2. > > > I write programs on SoloLearn mobile app. > > > > Warm regards, > Julia Kim > > _______________________________________________ > Python-ideas mailing list > [email protected] > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ >
_______________________________________________ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/
