2023年6月7日
摘要: 举例展示 Python在循环中修改遍历的字符串,将不会影响循环的遍历顺序和执行轮数 astr = "abcaef" bstr = "bcef" for i in astr: if i not in bstr: astr = astr.replace(i,'') print(i) 如上示例代码中,当i 阅读全文
posted @ 2023-06-07 17:47 shui00cc 阅读(140) 评论(0) 推荐(0) 编辑