def myfind(S,T):
i=0
while i<=len(S)-len(T)+1:
if T==S[i:i+len(T)]:
return i+1
i +=1
return -1
print(myfind("1234","23"))
欢迎分享,转载请注明来源:内存溢出
def myfind(S,T):
i=0
while i<=len(S)-len(T)+1:
if T==S[i:i+len(T)]:
return i+1
i +=1
return -1
print(myfind("1234","23"))
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)