s = "python二级考试,我来了,我一定会通过python考试的"
# 传两个参,全替换(参1旧词,参2新词)
res = s.replace("python", "java")
print(res)
# 传三个参,第三参控次数
res2 = s.replace("python","php",1)
print(res2)
s = "python二级考试,我来了,我一定会通过python考试的"
# 传两个参,全替换(参1旧词,参2新词)
res = s.replace("python", "java")
print(res)
# 传三个参,第三参控次数
res2 = s.replace("python","php",1)
print(res2)
暂无评论
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14