I want my code to be able to find strings: \'AB\' and \'BA\' without overlapping. i tried:
word = input() x = word.find(\'AB\') y = word.find(\'BA\') if x !=