Mar-27-2020, 12:06 AM
str.count(sub[,start[,end]]) should allow a tuple of strings for sub, such that it counts any of the non-overlapping strings in the tuple.
'abcdef'.count(('ab','de'))
-> 2
str.endswith() and str.startswith() already accept tuples. why not lists, or sets, or frozensets. this could also be done for str.find(), str.index(), str.rfind(), and str.rindex().