58869333 发表于 2022-2-22 20:22:26

这个画横线的为什么这么用

58869333 发表于 2022-2-22 20:33:38

count函数知道了

isdkz 发表于 2022-2-22 20:37:02

count = eachline.count(rep_word)   统计 rep_word 在 eachline 中出现的次数并赋值给 count
eachline = eachline.replace(rep_word, new_word)   将 eachline 中的 rep_word 替换为 new_word 后重新赋值为 eachline

58869333 发表于 2022-2-22 20:45:11

小伙子太帅了
页: [1]
查看完整版本: 这个画横线的为什么这么用