list_all=[] oper_s="abcdaaaa" i_num=0 while(True): x=oper_s.find("a",i_num) print(x) if(not x==-1): i_num=x+1 list_all.append(x) else: break print(list_all)
原文地址:https://www.cnblogs.com/sea-stream/p/10493245.html
时间: 2024-11-19 15:40:46
list_all=[] oper_s="abcdaaaa" i_num=0 while(True): x=oper_s.find("a",i_num) print(x) if(not x==-1): i_num=x+1 list_all.append(x) else: break print(list_all)
原文地址:https://www.cnblogs.com/sea-stream/p/10493245.html