python方法replace

时间:2025-01-04 11:43:20

1、1启动PYTHON3.7,如图所示

python方法replace

2、2创建列表如图所示

python方法replace

3、3测试如图所示

python方法replace

4、4方法replace将指定子串都替换为另一个字符串

python方法replace

5、5测试结果如图所示

python方法replace

6、6测试,没有找到对应的搜索目标,效果如图所示

python方法replace

7、7举例测试,效果如图所示

python方法replace
© 手抄报圈