This is my code:
a = 'BANANAAAS'
sub='AA'
print(a.count(sub))
Why does it not print 2 as an answer since the substring appears 2 times? The first one begining in a[5] and the other begining in a[6].
This was a part of a larger problem where I have to generate and count all the substring in a string depending if it begins with a vowel or not.