how to find two strings without overlap in python

后端 未结 0 1304
小鲜肉
小鲜肉 2020-12-28 17:04

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 !=         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题