标签:开始 数加 rgba python def div abc code color
def search_substr(s1, s2): if len(s2) > len(s1): return 0 cnt = 0 for i in range(len(s1)): print(i) tmp = s1[i:i+len(s2)] print(tmp) if s2 in tmp: cnt += 1 return cnt print(search_substr("dabcddabc","abc"))
输出:
0 dab 1 abc 2 bcd 3 cdd 4 dda 5 dab 6 abc 7 bc 8 c 2
标签:开始 数加 rgba python def div abc code color
原文地址:https://www.cnblogs.com/v5captain/p/14634455.html