博客已经迁移:https://www.yemilice.com/ 文章不会再双更新,感谢多年陪伴,新博再见。
import
re
s0
=
'BOY and GIRL'
s1
re.sub(r
'BOY|GIRL'
,
'HUMAN'
, s0)
print
# HUMAN and HUMAN
替换方法。
博客园 © 2004-2025 浙公网安备 33010602011771号 浙ICP备2021040463号-3